jQuery to detect when buttons are clicked and trigger a handler function. code example
Example: detect button click jquery
$(".btn").click(function(){
var clk = $(this).attr("id");
});
$(".btn").click(function(){
var clk = $(this).attr("id");
});