I'm looking for a way to list all events added to a certain element by Javascript. I know getEventListeners is available in dev tools, but it is not available in script.
I know with jQuery, I can check events with the below code. However, as this is a private method, it can only list events added by jQuery.
$._data(element, 'events')
I also checked this page, but this method needs to be executed before events are added. https://www.sqlpac.com/en/documents/javascript-listing-active-event-listeners.html
After all, is there no general way to check if an element has events after those events are added?