jQuery onclick delete table row

后端 未结 5 1232
别跟我提以往
别跟我提以往 2021-01-16 14:07

How to delete table row on click?

Here is a jsfiddle.

I want to delete only row on which del link is nested, not the last row how script is doing now.

<
5条回答
  •  無奈伤痛
    2021-01-16 14:54

    Use

    $(this).parent().parent().remove();
    

    on the anchor tags. So if your link is a child of a td, which is a child of tr, then tr will be removed.

提交回复
热议问题