JSFiddle - React, Tailwind, and code Playground
HTML
<div id="output">
</div>
JavaScript
function _getInternetExplorerVersion() {
let rv = -1;
if(navigator.appName === 'Microsoft Internet Explorer') {
let re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if(re.exec(navigator.userAgent) !== null){
rv = parseFloat( RegExp.$1 );
}
}
else if(navigator.appName === 'Netscape') {
let re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})");
if(re.exec(navigator.userAgent) !== null) {
rv = parseFloat(RegExp.$1);
}
}
return rv;
}
function isWindows7IE11(){
return (_getInternetExplorerVersion() === 11) && (navigator.appVersion.indexOf("Windows NT 6.1") !== -1);
}
var div = document.getElementById("output");
if (isWindows7IE11()){
div.innerHTML = "Windows 7 IE 11";
}else{
div.innerHTML = "Not windows 7, IE 11";
}