Created
May 31, 2022 07:12
-
-
Save tnibert/53aed1d073b0ea6fe8d40065a3e972c9 to your computer and use it in GitHub Desktop.
Find all js events fired for given object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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