How to remove next row tr from table in jquery

satinder singh / Updated : / 0 Comments

 jQuery remove tr: This article explains how to delete tables next row .i.e how to remove or delete next row / tr from a table on a button click in jquery. For selecting next element we use .next() jQuery method, so we can able to delete next row from selected element.

 jQuery .next() method get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.


Code: code to delete next tr

// *

$("#tbUser").on('click', '.btnDelete', function () {
    $(this).closest('tr').next().remove();
});

// *

VIEW DEMO

 

 

 


Post Comment


Your email address will not be published. Required fields are marked *