Thursday, June 6, 2013

Inspect all the event handlers on a DOM Element

Here’s how chrome Developer Tools make it super simple. Just inspect an element and look inside the Event Listeners section as shown:

Expand any event and you can see what element level the event is handled on e.g. here blur is handled on document as well as the div:

You can even jump to the function body (this is a minified file so it’s all on line 1) by clicking on the filename

As an aside: there is no way to do this in your own code