This solution needs the jQuery's data method.
$._data($(".example").get(0), "events")
$._data()
is just accessing jQuery's data method. A more readable alternative could be jQuery._data()
.
Interesting point by this SO answer:
As of jQuery 1.8, the event data is no longer available from the "public API" for data. Read this jQuery blog post. You should now use this instead:
jQuery._data( elem, "events" );
elem should be an HTML Element, not a jQuery object, or selector.Please note, that this is an internal, 'private' structure, and shouldn't be modified. Use this for debugging purposes only.
In older versions of jQuery, you might have to use the old method which is:
jQuery( elem ).data( "events" );
A version agnostic jQuery would be: (jQuery._data || jQuery.data)(elem, 'events');