STRIX
HTMLTricks: Revision 4

Kako u plain HTML-u detektirati postojanje/verziju M$ Internet Explorera?

Internet Explorer 5.0 i veće verzije prepoznaje neke uvjete unutar HTML komentara, tzv. /conditional comments/.
Ostali browseri zanemarit će cijeli takav blok kao običan HTML komentar.

Evo primjera:

<body>
<!--[if IE]>
    According to the conditional comment, this is Internet Explorer.<br>
<![endif]-->
<!--[if IE 5]>
    According to the conditional comment, this is Internet Explorer 5.<br>
<![endif]-->
<!--[if IE 5.0]>
    According to the conditional comment, this is Internet Explorer 5.0.<br>
<![endif]-->
<!--[if IE 5.5]>
    According to the conditional comment, this is Internet Explorer 5.5.<br>
<![endif]-->
<!--[if IE 6]>
    According to the conditional comment, this is Internet Explorer 6.<br>
<![endif]-->
<!--[if gte IE 5]>
    According to the conditional comment, this is Internet Explorer 5 and up.<br>
<![endif]-->
<!--[if lt IE 6]>
    According to the conditional comment, this is Internet Explorer lower than 6.<br>
<![endif]-->
<!--[if lte IE 5.5]>
    According to the conditional comment, this is Internet Explorer lower or equal to 5.5.<br>
<![endif]-->
</body>

Za više informacija vidi ovdje.