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