javascript - use jQuery to find an event object -
jquery has wonderful selectors dom elements, can 'select' event object.
that is, if use inline javascript on 'onclick' attribute of element, have selector find event object can act on it.
i know this:
$("a#some_link").click(function(event){//act on event here});
but how find event object if inline javascript used:
<a href="somepage.html" onclick="alert('how event oject?');">click me</a>
this question supplement earlier question: calling e.stopimmediatepropagation() onclick attribute
onclick = "alert(event.type);return false;" <a id="some_link" href="somepage.html" onclick="alert(event.type);return false;">click me</a>
Comments
Post a Comment