nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
动态增删表格行 <script> <BR><!-- <BR>//author: Robin <BR>//email: griefforyou@gmail.com <br><br>var rowIndex=0; <BR>function addLine(obj){ <BR>var objSourceRow=obj.parentNode.parentNode; <BR>var objTable=obj.parentNode.parentNode.parentNode.parentNode; <BR>if(obj.value=='增加'){ <BR>rowIndex++; <BR>var objRow=objTable.insertRow(rowIndex); <BR>var objCell; <br><br>objCell=objRow.insertCell(0); <BR>objCell.innerHTML=" "; <br><br>objCell=objRow.insertCell(1); <BR>objCell.innerHTML=objSourceRow.cells[1].innerHTML; <br><br>objCell=objRow.insertCell(2); <BR>objCell.innerHTML=objSourceRow.cells[2].innerHTML.replace(/增加/,'删除'); <BR>} <BR>else{ <BR>objTable.lastChild.removeChild(objSourceRow); <BR>rowIndex--; <BR>} <BR>} <br><br>function removeLine(){ <br><br>} <br><br>//--> <BR></script>