<input type="button" οnclick="addNewRow();" value="添加更多"/>
function addNewRow(){ var num=document.getElementById("num").value; var newNum=(num-0)+1; document.getElementById("num").value=newNum; var length=document.getElementById("dataApt").rows.length; newRow=document.getElementById("dataApt").insertRow(3); newRow.id="newId"; td1=newRow.insertCell(0); td1.id="appVersion"; td1.innerHTML="版本号"; td2=newRow.insertCell(1); var input = document.createElement("input"); input.id="appversion"+num; input.name="appversion"+num; td2.appendChild(input); td3=newRow.insertCell(2); td3.id="md5s"; td3.innerHTML="MD5值"; td4=newRow.insertCell(3); var input = document.createElement("input"); input.id="md5value"+num; input.name="md5value"+num; td4.appendChild(input); }