Never been to DZone Snippets before?

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

动�添加一行表格 (See related posts)

// 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>

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts