I have a table with and id of foo and I want to add rows dynamically that have a button that do something. How can I assign the listeners for the buttons dynamically using JQuery?
Thanks
You can use the bind method to assign event listeners if your buttons are already present or use the live or delegate methods if the buttons are generated dynamically.
Try with live() method:
$('.edit').live('click', function(){
// your code here...
});