如何将tbody中指定id的tr移除
如下这个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>