I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event?

Events are attached using:

  1. Prototype’s Event.observe;
  2. DOM’s addEventListener;
  3. As element attribute element.onclick.

19 s
19

Chrome, Firefox, Vivaldi and Safari support getEventListeners(domElement) in their Developer Tools console.

For majority of the debugging purposes, this could be used.

Below is a very good reference to use it:
https://developers.google.com/web/tools/chrome-devtools/console/utilities#geteventlisteners

Leave a Reply

Your email address will not be published. Required fields are marked *