This is a demo for Delete table row on user click blog post.
| This is a table with id="table1" | Column 2 |
| row 2, cell 1 | Column 2 |
| row 3, cell 1 | Column 2 |
| row 4, cell 1 | Column 2 |
| row 5, cell 1 | Column 2 |
Code:
$(document).ready(function(){
$('#table1 td').click(function(){
$(this).parent().remove();
});
});
| row 1, cell 1 | ![]() |
| row 2, cell 1 | ![]() |
| row 3, cell 1 | ![]() |
| row 5, cell 1 | ![]() |
| row 5, cell 1 | ![]() |
Code:
$(document).ready(function(){
$('#table2 td img.delete').click(function(){
$(this).parent().parent().remove();
});
});