Skip to content

Instantly share code, notes, and snippets.

@kig
Created August 20, 2013 04:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kig/6276990 to your computer and use it in GitHub Desktop.
Save kig/6276990 to your computer and use it in GitHub Desktop.
Log all events to an element
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