Created
August 20, 2013 04:02
-
-
Save kig/6276990 to your computer and use it in GitHub Desktop.
Log all events to an element
This file contains hidden or 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
var logEvents = function(el) { | |
Object.getOwnPropertyNames(el).join(" ").match(/\bon\S+/g).forEach(function(n){el[n]=function(e){console.log(e.type,e)}}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment