7 down vote | I generate a table dynamically out a database, receive the data in JSON and put it into a table. Every table row got a unique ID, which is needed for further actions, so, if the DOM is altered you need a different approach: $("table").delegate("tr", "click", function() { var id=$(this).attr('id'); alert("ID:"+id); }); |
7 down vote | I generate a table dynamically out a database, receive the data in JSON and put it into a table. Every table row got a unique ID, which is needed for further actions, so, if the DOM is altered you need a different approach: $("table").delegate("tr", "click", function() { var id=$(this).attr('id'); alert("ID:"+id); }); |