Created
June 23, 2010 15:34
-
-
Save ricardobeat/450086 to your computer and use it in GitHub Desktop.
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 testAttributeSupport() { | |
var head = document.getElementsByTagName('head')[0]; | |
var style = document.createElement('style'); | |
var s = 'div[id] {}'; | |
style.type = 'text/css'; | |
if (style.styleSheet) | |
style.styleSheet.cssText = s; | |
else | |
style.appendChild( document.createTextNode(s) ); | |
head.appendChild( style ); | |
s = style.sheet || style.styleSheet; | |
s = (s.rules || s.cssRules)[0]; | |
return (s.selectorText || s.cssText).toLowerCase() == 'div[id]'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment