javascript check which button was clicked code example
Example: how to get the id of button clicked in jquery
$("button").click(function() {
alert(this.id); // or alert($(this).attr('id'));
});
$("button").click(function() {
alert(this.id); // or alert($(this).attr('id'));
});