且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用jQuery删除表格行

更新时间:2023-01-17 18:19:30

您需要使用事件委派,因为这些按钮在负载中不存在:

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;
 });