How to remove next row tr from table in jquery

 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

 

 

 

Share:    
Satinder Singh

Hi all, am Founder and Author of Codepedia.info, also atypical polyglot programmer from Bombay, India. I have a passion to create, solve, and deploy software applications.
       ForEach ( minute in MyLife ) { myExperience++ ; }



Post Comment


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