I have a set of buttons with ids "del1", "del2", and so on. I'm trying to make an onclick function that fires when any of those buttons are clicked on. So basically replace:
$(document).on('click', '#del1', function(e) {
alert("For button1");
});
$(document).on('click', '#del2', function(e) {
alert("For button2");
});
etc
With a single function. The amount of buttons can change, and there's no limit to the amount of buttons. How can I do this?