Skip to content

Instantly share code, notes, and snippets.

@termi
Created September 25, 2012 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save termi/3784699 to your computer and use it in GitHub Desktop.
Save termi/3784699 to your computer and use it in GitHub Desktop.
:scope support test
function testForRealScopePreudoClassSupport() {
var scopeSupport = false
, tmp = document.createElement("b")
;
tmp.innerHTML = "<i>t</i>";
try {
scopeSupport = tmp.querySelector(":scope>i");
scopeSupport = scopeSupport && scopeSupport.innerHTML == "t";
}
catch(e) {
scopeSupport = false
}
return scopeSupport;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment