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
Post a Comment