I have 50 dynamically generated HTML buttons as follows:
I would apply it to the parent element of the buttons. So if all of the buttons were in The key is to be specific enough that you do not have to specify each selector but not too lose as there may be other buttons, etc. on the page that you do not want to include. Updated code to include delegation.$('#myButtons').on('click', 'button' function () {
// Do stuff...
});