HTML代码
<table border="1" cellpadding="0" cellspacing="0" width="800" id="tables">
<tr><td>参数名</td><td>参数值<input type="button" value="添加一行" onclick="addonerow()" /></td></tr>
<tr id="parameters"><td><input type="text" value="" id="parametername" name="parametername" /></td><td><input type="text" value="" id="parametervalue" name="parametervalue" /></td></tr>
</table>
JS代码
function addonerow(){
var mytable=document.getElementById("tables");
var myrow=document.getElementById("parameters");
if(navigator.userAgent.indexOf("Firefox") != - 1)
{
mytable.tBodies[0].appendChild(myrow.cloneNode(true));
}else{
mytable.tBodies[0].insertBefore(myrow.cloneNode(true));
}
}