mkoryak
is correct.
But, if events are bound to that DOM node using more modern methods (not using onclick
), then this method will fail.
If that is what you really want, check out this question, and its accepted answer.
Cheers!
I read your question again.
I'd like to tell you this: don't use onclick
, onkeypress
and the likes to bind events.
Using better methods like addEventListener()
will enable you to:
Instead of actually using addEventListener()
, you could use jQuery
wrappers like $('selector').click()
.
Cheers again!