detect button click jquery

JavaScript
$(".btn").click(function(){
  var clk = $(this).attr("id");
});
Source

Also in JavaScript: