62,046
社区成员
发帖
与我相关
我的任务
分享
<html>
<head><title>test</title>
<script type="text/javascript" src="jquery1.9.1.js"></script>
<script type="text/javascript">
$(function(){
$("#tdadd").click(function(){
var td ="<tr> <td>111</td> <td>222</td> <td>333</td> <td><input type=\"button\" onclick=\"$(this).parent().parent().remove();\" value=\"DEL\" class=\"delbtn\"/></td> </tr>";
$("#inserttable").append(td);
});
});
</script>
<style type="text/css">
</style>
</head>
<body>
<table style="width:500px;" border="1">
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
<td><input type="button" value="添加一行" id="tdadd" /></td>
</tr>
</table>
<div style="height:150px;width:520px;overflow:auto;border:1px solid #ccc; ">
<table style="width:500px;" border="1" id="inserttable">
</table>
</div>
</body>
</html>