I want the following functionality:
When the user clicks on any row it will get deleted.
I have tried the following, but there is a problem. If you click on the row it gets deleted fine, but when you add row by clicking on #click, the row is not getting deleted when I click on it.
Here's my code:
SCRIPT
$(document).ready(function(){
$('#click').click(function(){
$('#table').append('<tr><td> </td></tr>');
})
$('#remove').click(function(){
$('#table tr:last').remove();
})
$('#table tr').click(function(){
$(this).remove();
});
})