0
在這種創建錯誤, 我neesd動態創建行和刪除,請幫我請驗證此代碼給我一個建議?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Dynamic Rows</title>
<script src="Include_Files/jquery-1.4.2.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$("<table class='ta1' border='1'></table>").appendTo('.table1');
$('.add').click(function(){
addRows();
};
function addRows(){
$table=$(".ta1");
$("<tr class='ta1'><td>rajasekhar</td><td>hostanalytics</td></tr>").appendTo($table);
}
});
</script>
</head>
<body>
<div id="table1"></div>
<input type="button" class="add" name="add" value="AddRows"/>
<input type="button" class="delete" name="delete" value="DeleteRows"/>
</body>
</html>
太感謝你了...! – rajasekhar 2010-12-20 04:14:46