Some times we need simple method to check if the browser is IE or not. This is how it could be:
var isMSIE = (/trident/i).test(navigator.userAgent);
if(isMSIE)
{
/* do something for ie */
}
else
{
/* do something else */
}
or simplified siva's method:
if(!!navigator.systemLanguage)
{
/* do something for ie */
}
else
{
/* do something else */
}
MSIE v.11 check:
if( (/trident/i).test(navigator.userAgent) && (/rv:/i).test(navigator.userAgent) )
{
/* do something for ie 11 */
}
other IE browsers contain MSIE string in their userAgent property and could be catched by it.