javascript - calling e.stopImmediatePropagation() from onclick attribute -


how event object onclick attribute?

i have tried:

<a href="something.html" onclick="function(e){e.stopimmediatepropagation();}">click me</a> 

also, have tried this:

<a href="something.html" onclick="console.log(this);">click me</a> 

but console shows <a> element.

i think you'd have define function in <script/> tag elsewhere.

would bad use like:

 <script type="text/javascript">     $('#something_link').click(function(e) {         e.stopimmediatepropagation();     }); </script> <a href="something.html" id="something_link">click me</a> 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -