I am putting something together which has lots of buttons and each button does a different thing.
The way I've done it is like this:
$( "#somebutton" ).click(function() {
//Do something
});
$( "#someotherbutton" ).click(function() {
//Do something else
});
$( "#someotherbutton" ).click(function() {
//Do something else
});
$( "#someotherbutton" ).click(function() {
//Do something else
});
...and so one...
My question is...
Is there a better way to do this for example having an array with button id's and this calling functionsafter the click event?