title: Detecting if IE7 or lower with conditional comments and javascript not working
body: <p>I'm trying to check if a person is using anything IE with version less than 8 or anything else.</p>
  
  <p>I use conditional comments to declare boolean..</p>
  
  <pre><code>&lt;!--[if lt IE 8]&gt;
  &lt;script type="text/javascript"&gt;var badIE = true;&lt;/script&gt;
  &lt;![endif]--&gt;
  </code></pre>
  
  <p>And now I check in my js file the boolean like this:</p>
  
  <pre><code>if (badIE == true){
      alert('You have bad IE!');
  } else {
      alert('Bueno!');
  }
  </code></pre>
  
  <p>If I use IE7 or IE6, it alerts that "You have bad IE!". If I use anything else, it should alert "Bueno!", but it does not. What is the problem?</p>