JavaScript - getEventListeners(object)

Posted at

icompile.eladkarako.com_more_eventsReturns the event listeners registered on the specified object. The return value is an object that contains an array for each registered event type ("click" or "keydown", for example). The members of each array are objects that describe the listener registered for each type.

For example, the following lists all the event listeners registered on the document object.

getEventListeners(document);
Output of using getEventListeners()




 

If more than one listener is registered on the specified object, then the array contains a member for each listener. For instance, in the following example there are two event listeners registered on the#scrollingList element for the "mousedown" event:



You can further expand each of these objects to explore their properties:

Expanded view of listener object