How to get the list of event listeners for a dom element in javascript

Some­times when debug­ging its use­ful to be able to query the list of event lis­ten­ers on the DOM ele­ment. You can eas­ily do that by typ­ing the fol­low­ing com­mand in the console

getEventListeners(domElement);

NOTE: This func­tion is only avail­able to help you debug some­thing in the chome con­sole and and is not avail­able through reg­u­lar javascript as of this writing.


Ryan Sukale

Ryan is a UX engineer living in San Francisco, California.

You may also like...