How to get ID of button user just clicked? [duplicate] May 23, 2023 by Tarik $("button").click(function() { alert(this.id); // or alert($(this).attr('id')); });