jQuery onclick delete table row

后端 未结 5 1236
别跟我提以往
别跟我提以往 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:47

    $('td a').on('click',function(e){
       //delete code.
       e.preventDefault();
       $(this).parent().parent().remove(); // OR $(this).parents('tr').remove();
    });
    

提交回复
热议问题