Javascript in anchor href: get reference to "calling" anchor tag -


this question has answer here:

<a href="javascript: get_a_reference_to_the_a_tag.dosomethingwithit();">... 

is there way reference anchor tag in href javascript without adding id anchor tag?

add this function call, you'll need onclick, otherwise, this reference window:

<a href="#" onclick="yourfunction(this)">...</a> 

jsbin


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -