如下这个table的主体tbody以及js代码:
<tbody id="mainbody"> <tr id="delCell"> <td>name</td> <td>address</td> </tr></tbody>
<script type="text/javascript"> function deleteCell(bodyname,cellname){ var mailbody = document.getElementById(bodyname); var cell = document.getElementById(cellname); if(cell != undefined){ mainbody.removeChild(cell); } } </script>
时间: 2024-11-05 12:23:02