Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

if conditional statement not working with IE 11 [duplicate]

Tags:

I am using IE 11 version. Is there any other solution to do the following:

Nothing happens when I try to use conditional IE clause in the html webapge. Can anyone help me debug this issue please.

<!--[if IE]>
<a href="next-page.php" class="start-button">CLICK ME</a>
<![endif]-->
like image 926
Mit Rocks Avatar asked Dec 14 '14 13:12

Mit Rocks


1 Answers

Conditional statements do not work in IE 10 or 11

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. This means that Conditional Comments are now treated as regular comments, just like in other browsers. This change can impact pages written exclusively for Windows Internet Explorer or pages that use browser sniffing to alter their behavior in Internet Explorer.

If you really need to execute code just on those browsers, and you probably shouldn't, you can use JavaScript to do some feature detection as an alterantive.

like image 120
John Conde Avatar answered Nov 04 '22 23:11

John Conde