I have 50 dynamically generated HTML buttons as follows:
if you have all the buttons inside of a container and you want the same function for all add the click handler to the container
DEMO
$("#container").on("click", function(e){ if(e.target.type =="button") { alert(e.target.id); } }); something