Skip to content

Instantly share code, notes, and snippets.

@realdeprez
Created May 18, 2011 06:16
Show Gist options
  • 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){}
@nxame
Copy link

nxame commented Jun 30, 2016

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