{"id":394,"date":"2013-12-03T07:25:54","date_gmt":"2013-12-03T06:25:54","guid":{"rendered":"https:\/\/devpath.pro\/?p=394"},"modified":"2013-12-03T07:25:54","modified_gmt":"2013-12-03T06:25:54","slug":"retrieve-js-events-how-to-get-all-of-them","status":"publish","type":"post","link":"https:\/\/fabiocicerchia.it\/web\/retrieve-js-events-how-to-get-all-of-them","title":{"rendered":"Retrieve JS Events: how to get all of them"},"content":{"rendered":"\n

I was trying to face an apparently huge problem, collect all the events bound<\/strong>\u00a0to the DOM elements. Then I realised that the main\u00a0obstacle <\/em>was the\u00a0browser<\/em>, yes the browser.
Because of the way the browser manage the events.<\/p>\n\n\n\n

So I started my research about it, nothing came from Google or StackOverflow.<\/p>\n\n\n\n

This answer made me think and for a second I was about to give up on that:<\/p>\n\n\n\n

\n

Event handlers attached using DOM Level 2 Events addEventListener methods and IE’s attachEvent cannot currently be retrieved from script at all. DOM Level 3 once proposed element.eventListenerList to get all listeners, but it is unclear whether this will make it to the final specification. There is no implementation in any browser today.<\/p>\n

—\u00a0bobince<\/a><\/p>\n<\/blockquote>\n\n\n\n

There are few ways to bind an event we should focus on:<\/p>\n\n\n\n