function deleteRow(r) { var i=r.parentNode.parentNode.rowIndex document.getElementById('myTable').deleteRow(i) }
<table id="myTable" border="1"> <tbody> <tr> <td>Row 1</td> <td><input type="button" value="删除" onclick="deleteRow(this)"></td> </tr> <tr> <td>Row 2</td> <td><input type="button" value="删除" onclick="deleteRow(this)"></td> </tr> <tr> <td>Row 3</td> <td><input type="button" value="删除" onclick="deleteRow(this)"></td> </tr> </tbody> </table>