the code below add and remove table row with the help of Jquery the add function works fine but the remove only work if I remove the first row
You need to use event delegation because those buttons don't exist on load:
http://jsfiddle.net/isherwood/Z7fG7/1/
$(document).on('click', 'button.removebutton', function () { // <-- changes alert("aa"); $(this).closest('tr').remove(); return false; });