If you want to know that this browser is IE or not. You can check by following code:
<script>
function isIE() {
ua = navigator.userAgent;
/* MSIE used to detect old browsers and Trident used to newer ones*/
var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
return is_ie;
}
/* Create an alert to show if the browser is IE or not */
if (isIE()){
alert('It is InternetExplorer');
}else{
alert('It is NOT InternetExplorer');
}
</script>
<script>
function isIE() {
ua = navigator.userAgent;
/* MSIE used to detect old browsers and Trident used to newer ones*/
var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
return is_ie;
}
/* Create an alert to show if the browser is IE or not */
if (isIE()){
alert('It is InternetExplorer');
}else{
alert('It is NOT InternetExplorer');
}
</script>