How to find event listeners on a DOM node using JavaScript

Of course browsers internally have a list of event listeners, but it is not exposed to page-level JavaScript. For example, Firebug (or Eventbug) probably use nsIEventListenerInfo.

That being said, this old answer still holds:
How to find event listeners on a DOM node?


The console of Chrome has a method that can help you check if a dom node has any event listeners registered; for example to check event listeners attached to the document node using:

https://developers.google.com/chrome-developer-tools/docs/commandline-api#geteventlistenersobject

getEventListeners(document);

If needed, you could recursively iterate over all dom nodes and find all event handlers attached.

Tags:

Javascript