Skip to content

Instantly share code, notes, and snippets.

@ridgehkr
Last active December 19, 2015 16:39
Show Gist options
  • Save ridgehkr/5985810 to your computer and use it in GitHub Desktop.
Save ridgehkr/5985810 to your computer and use it in GitHub Desktop.
Detect IE versions in JS without conditional compliation. If there's a match, then the IE version class is added to the html tag.
test_version = 10 # which version of IE to test for
isIE10 = document.documentMode? and document.documentMode == test_version
if isIE10 then document.documentElement.className += ' ie10'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment