Last active
September 2, 2018 02:04
-
-
Save jonathantneal/5ca2cf0d5b0c39c2450d to your computer and use it in GitHub Desktop.
HTMLElement polyfill for IE6-7
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
if (!window.Element) { | |
(function (prototype) { | |
function Element() {} | |
prototype.runtimeStyle.cssText = 'clip:rect(0 0 0 0);height:0;position:absolute;width:0'; | |
document.getElementsByTagName('head')[0].appendChild((window.Element = Element).prototype = prototype).attachEvent('onpropertychange', function (event) { | |
for (var name = event.propertyName, index = 0, element; element = document.all[index]; ++index) { | |
if (element !== prototype) { | |
element[name] = prototype[name]; | |
} | |
} | |
}); | |
})(document.createElement('Element')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jonathantneal What's the reason behind this reset?