Detect Internet Explorer and display a message

navigator object has all details related to browser and platform details of clients machine.

navigator.userAgent gives browser related details.

JS snippet:

<script>
  var x = navigator.userAgent;
  alert(' browser details ' + x);
</script>

Below link talks at length about it in detail :

http://www.javascriptkit.com/javatutors/navigator.shtml


Try this

 if ($.browser.msie) {
    // you are using IE
 }

More detail : jquery.browser


Conditional HTML comments will work for detecting IE9 or less. From the HTML5 Boilerplate, which I highly suggest you use:

<!--[if lt IE 7]>
    <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->