Wednesday, 19 December 2018

jquery - Get all event listeners that are on an object in javascript

One tricky way is to use jQuery's internal function _data() to get these :


var element = document.querySelector('#its-your-thing'),
list_of_events = $._data(element, "events");

Careful thought, I do not have information about its behavior across versions (working at least in 1.9.0)

No comments:

Post a Comment