I am working on a legacy web app which I am progressively ajaxifying and have found the need to stop event propagation from an inline onclick
handler.
Take this for example:
<a id="inner" onclick="return handleOnclick();" href="#">Some link</a>
Apart from the onclick
handler, there are listeners added with addEventListener
. I need that under certain conditions the onclick
handler can stop the propagation of the event. I've tried event.stopPropagation()
but it does not seem to work. Here's a jsfiddle to test:
http://jsfiddle.net/APQk6/985/
Any ideas?