Skip to content

Instantly share code, notes, and snippets.

@cbednarski
Last active December 25, 2015 01:59
Show Gist options
  • Save cbednarski/6899330 to your computer and use it in GitHub Desktop.
Save cbednarski/6899330 to your computer and use it in GitHub Desktop.
Enumerate all jquery event handlers on the page
// jQuery 1.4
$("*").each(function(){
var data = $(this).data();
if(typeof data !== "undefined" && typeof data.events === "object") {
console.log(data.events);
}
});
// jQuery 1.7
$("*").each(function(){
var data = $(this).data();
if(typeof data[$.expando] !== "undefined" && typeof data[$.expando].events === "object") {
console.log(data[$.expando].events);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment