title: Changing the color based on its value
body: <p>I'm trying to get the value of cookies enabled to turn red if false or green if true but I've only been able to change the color regardless if it's true or false, is there another way around this using JS?</p>
  
  <p>Or if you were to take it one step further, is it possible to put in an image (red X or green Tick) after the value?</p>
  
  <p><strong>HTML</strong>   </p>
  
  <pre><code>&lt;table class="table"&gt;
    &lt;tr&gt;
      &lt;td&gt;Cookies Enabled:&lt;/td&gt;
      &lt;td id="cookie"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var Cookies; {
    if (navigator.cookieEnabled) {
      Cookies = "True";
    } else {
      Cookies = "False";
    }
  }
  window.onload = function () {
   document.getElementById("cookie").innerHTML = Cookies;
  }
  </code></pre>