代碼如下:$('.a2').click(function () { var b3 = $('.b3').val(); var b4 = $('.b4').val(); var newRow = "<tr><td>" + b3 + "</td><td>" + b4 + "</td><td><button class='btn btn-danger" + " btn-xs' id='a4'>刪除</button></td></tr>"; $(".c1").append(newRow); }); $('#a4').click(function () { alert('1'); $(this).parents('tr').remove(); }) 想實現動態刪除添加的行 ,但是按照我上面的刪除按鈕沒有反應,是因為button不能直接使用append添加到行里面嗎?
用append添加的行如何動態刪除?
阿波羅的戰車
2018-12-25 21:15:24