2014-09-26 71 views
-2

该按钮位于此TR上,我可以使用以下代码轻松删除它。如何删除下一个TR删除下一个元素 - Javascript

E.g.

<TR></TR> --> Code works with removing this 
<TR></TR> --> Remove the next TR THis one 

var $this = $(this), 
orderTr = $this.parents('tr'); 
orderTr.remove(); 
+0

来吧。这是jQuery中最基本的操作之一。你能不能至少访问API文档并在搜索栏中输入“next”? http://api.jquery.com/ – 2014-09-26 16:36:19

回答

1

您可以像使用

$(this).closest("tr").next().remove(); 

$(this).parents("tr").next().remove();