I'm updating a page through ajax, so I'm creating (text) buttons dynamically. I know how to set up an onclick event, but then how to I get the id of the button in the handler?
Using sinatra with ruby and jquery 1.5. Here is the partial code:
<div onclick='my_handler()' ><a><href>[Edit]</href></a></div>
and the js code:
function my_handler (){
alert ("button id is ..." )
}
thanks
hrefisn't a tag, and yourdivdoesn't have anidparameter