title: How to compare colors in JavaScript?
body: <p>Why doesn't this work? Even though the colour <em>is</em> equal to <code>#ECECF4</code> it still alerts "No".
  It is selecting the corrent element as I have tested it. Is there a better way to write this?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function weekclick() {
      if (document.getElementById('w1').style.backgroundColor == "#ECECF4") {
          alert("Yes");
      } else {
          alert("No");
      }
  }
  
  &lt;/script&gt;
  </code></pre>