Maybe there are serval sub-questions for my problem:
- Is there a general solution to get events binded to an element?(Without jquery or others javascript librarys).
- I found
$(element).data('events')
can't get event registered with<element onclick="some_functions()">
. How can we get it?
My goal is to insert an event before native event (registered by the programmer of html page). I found two solutions.
- Using jQuery as described here
- modify
HTMLElement.prototype.addeventlister
as described here
However, I find both these methods can't solve the situation like that
<element onclick="some_functions()">