How to delete table row on click?
Here is a jsfiddle.
I want to delete only row on which del link is nested, not the last row how script is doing now.
<
remove the onclick and replace with a class (ie. class="remove"). bind the event to the table - this will give you a performance gain over having lots of event handlers and make sure that new rows added will obey this behaviour too.
$('table').on('click','tr a.remove',function(e){
e.preventDefault();
$(this).closest('tr').remove();
});