DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

动�添加一行表格

02.22.2006
| 1282 views |
  • submit to reddit
        // description of your code here

<table border=1>
<tr id=a1>
<td><input></td><td><input></td>
</tr>
</table>
<input type=button name=ok onclick=add()>
<script language=JavaScript>
i=1
function add(){
var newTR = a1.cloneNode(true);
newTR.id="a"+(++i)
a1.parentNode.insertAdjacentElement("beforeEnd",newTR);
}
</script>