Codepedia
.info
Home
About
Demos
Tools
SVG Wave Generator
Colors
Edit This Code :
<html> <head><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> </head> <body> <table id="tbUser"> <tr> <th>Sr</th> <th>Name</th> <th>Location</th> <th></th> </tr> <tr> <td>1</td> <td>Amit</td> <td>Ghatkopar</td> <td> <button class="btnDelete">Delete</button> </td> </tr> <tr> <td>2</td> <td>Vicky</td> <td>Powai</td> <td> <button class="btnDelete">Delete</button> </td> </tr> <tr> <td>3</td> <td>Sunny</td> <td>Powai</td> <td> <button class="btnDelete">Delete</button> </td> </tr> <tr> <td>4</td> <td>John</td> <td>NewYork</td> <td> <button class="btnDelete">Delete</button> </td> </tr> </table> <script> $(document).ready(function(){ $("#tbUser").on('click', '.btnDelete', function () { $(this).closest('tr').next().remove(); }); }); </script> </body> </html>
➤ Run / View
Result :