Created
August 18, 2014 11:39
-
-
Save pbakondy/cf4c8f79a2cd3e6ce390 to your computer and use it in GitHub Desktop.
Get IE version
This file contains hidden or 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
// determine Internet Explorer version | |
// add class 'ieX' to html | |
window.ieVersion = (function() { | |
var ddm = document.documentMode; | |
var html = document.documentElement; | |
if (Math.round(ddm) === ddm){ | |
if (html.classList) { | |
html.classList.add('ie' + ddm); | |
} else { | |
html.className += ' ie' + ddm; | |
} | |
return ddm; | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment