I have an empty table to which I\'m adding rows via jQuery using:
$(\'#table > tbody:last\').append(\'\' + s
-
You add rows dynamically after you have bound the event to the existing ones. You may use delegated event approach to fix the problem:
$("#table").on("click", "tr", function(e) {
alert(this.id);
});
- 热议问题