Jquery closest function with example

Using the jquery closest method to look for the parent element and remove the entire row.


  • By clicking on remove button its respective row will be removed from the html table.
KevinAddress One +11111111111 email1@email.com
MarkAddress Two +2222222222 email2@email.com
HectorAddress Three +3333333333 email3@email.com

Input button with the selector class remove check for its closest parent class tblrow to remove the entire row from the html table.


HTML Table

Name Address Phone Email Remove
Kevin Address One +11111111111 email1@email.com
Mark Address Two +2222222222 email2@email.com
Hector Address Three +3333333333 email3@email.com