Skip to content

Instantly share code, notes, and snippets.

@tnibert
Created May 31, 2022 07:12
Show Gist options
  • Save tnibert/53aed1d073b0ea6fe8d40065a3e972c9 to your computer and use it in GitHub Desktop.
Save tnibert/53aed1d073b0ea6fe8d40065a3e972c9 to your computer and use it in GitHub Desktop.
Find all js events fired for given object
function seeAllEvt(myObj) {
for(var key in myObj){
if(key.search('on') === 0) {
myObj.addEventListener(key.slice(2), function (e) {
console.log(e.currentTarget + " " + e.type);
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment