1

I have this HTML

  <script>
    internet_explorer = false;
  </script>
  <!--[if IE]>
    <script type="text/javascript">
      internet_explorer = true;
    </script>
  <![endif]-->

and this JS:

console.log(internet_explorer)

When I run this on all browsers it should be false and it is. However, it is supposed to be true on Internet Explorer but it's false. What do I do wrong?

Kunok
  • 8,089
  • 8
  • 48
  • 89

1 Answers1

1

Conditional comments are no longer supported

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5.

Source: https://msdn.microsoft.com/en-us/library/hh801214(v=vs.85).aspx

Ben Temple-Heald
  • 708
  • 1
  • 6
  • 16