title: Why can't javascript use .style.color in if statments
body: <p>When in javascript you can't use if statments using the color of an element as a contition, for example there following if statment returns false always</p>
  
  <pre><code>    document.getElementById('t').style.color = "rgb(0,0,255)"
  
      alert(document.getElementById('t').style.color)
  
      if(document.getElementById('t').style.color == rgb(0,0,255))
      {
      alert("if")
      }
  </code></pre>
  
  <p>and the alert in line 3 returns rgb(0,0,255) meaning that the browser does in fact use rgb for the color. but alert("if") never works</p>
  
  <p>could someone help me with a way to get this to work or find an alternative way to mark a button (i need to do this for a button, not radio button) that isnt changing its class, for example changing some insignificant thing that the javascript will be able to check that isnt the color</p>
  
  <p>Thank you in advance!
  :)</p>
  
  <p>edit - Thanks for the answers, that helped, i feel like an idiot kinda :S i just selected the one with the least points to their name</p>