var browser = "Unknown"; // Internet Explorer 6-11 if (!!document.documentMode) { browser = "Internet Explorer"; } else if (!!window.StyleMedia) { browser = "Microsoft Edge"; } else if (window.chrome) { browser = "Google Chrome"; }