我在html中有
一个表格如下
<table>
<tbody>
<tr>
<td>test content</td>
<td><input type="button" onClick="remove()"></td>
</tr>
....
...
</tbody>
</table>
现在如果相同的模式继续,我想删除一行,如果删除按钮在该行上单击.我如何实现与jQuery相同?
更好:
$(this).closest('tr').remove();
More on closest()
<input type="button" onClick="$(this).closest('tr').remove();">
无论您的单元格中的HTML是什么样子,都可以工作.