Skip to content

Instantly share code, notes, and snippets.

@realdeprez
Created May 18, 2011 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save realdeprez/978071 to your computer and use it in GitHub Desktop.
Save realdeprez/978071 to your computer and use it in GitHub Desktop.
adds browser name+version class to html body tag
try{document.getElementsByTagName('body')[0].className+=' '+(/(Firefox|MSIE|Chrome|Safari|Opera)[\/\s](\d+)/).exec(navigator.userAgent).splice(1,2).join('').toLowerCase();}catch(e){}
@absqueued
Copy link

Add "Trident" in the option for IE 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment