jQuery: onclick method for every buttons with id starting with : <p>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:</p>

<pre><code>$(document).on('click', '#del1', function(e) {
    alert("For button1");
});

$(document).on('click', '#del2', function(e) {
     alert("For button2");
});

etc
</code></pre>

<p>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?</p>
