Skip to content

Instantly share code, notes, and snippets.

@hieblmedia
Forked from julianshapiro/IE.js
Created June 18, 2014 14:37
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 hieblmedia/62b9e516f3b609f98bff to your computer and use it in GitHub Desktop.
Save hieblmedia/62b9e516f3b609f98bff to your computer and use it in GitHub Desktop.
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
div = null;
return i;
}
}
}
return undefined;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment