i have a button:
<button id="my-button" type="button" onclick="action()">press me</button> i want to get the id of the button ("my-button"), in the "action" function.
i tried to get it with:
var id = $(this).id; var id = $(this).attr('id'); i tried to send the object from the dom:
<button id="my-button" type="button" onclick="action(this)">press me</button> and it didn't work...
how can i get the id?