how to get value of button that click on it jquery

JavaScript
$("button").click(function() {
    var button = $(this).val();
    alert(button);
});
Source

Also in JavaScript: