JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html id="whoAreYou">
<head>
<script>
window.onload = whoAreYou;
function whoAreYou(){
var N = navigator.appName, ua= navigator.userAgent, tem;
var M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d*)/i);
if(M && (tem = ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
M = M? [M[1], M[2]]: [N, navigator.appVersion,'unknown'];
M = M.toString().toLowerCase().replace(',','').replace('.','');
var element = document.getElementById("whoAreYou");
element.setAttribute("class", M); //For Most Browsers
element.setAttribute("className", M); //For IE; harmless to other browsers.
//alert(M);//for debugging
}
</script>
</head>
<body>
</body>
</html>