Created
March 7, 2012 13:47
-
-
Save guilhermehn/1993257 to your computer and use it in GitHub Desktop.
Javascript: Kill hard-coded events
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(d) { | |
var tags = d.body.getElementsByTagName('*'); | |
var i = tags.length; | |
while (i--) { | |
var attr = tags[i].attributes; | |
var ii = attr.length; | |
while (ii--) { | |
if (attr[ii].name.match(/^on/i)) { | |
tags[i][attr[ii].name] = null; | |
} | |
} | |
} | |
})(this.document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment