Skip to content

Instantly share code, notes, and snippets.

@eoftedal
Last active December 24, 2015 06:59
Show Gist options
  • Save eoftedal/6760554 to your computer and use it in GitHub Desktop.
Save eoftedal/6760554 to your computer and use it in GitHub Desktop.
var oldCreateElement = document.createElement;
document.createElement = function() {
var element = oldCreateElement.apply(document, arguments);
var oldSetAttribute = element.setAttribute;
console.log(arguments, element);
element.setAttribute = function(name, value) {
if (name == "onsubmit") {
console.log(arguments.callee.caller.toString());
}
oldSetAttribute.apply(element, arguments);
}
return element;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment