title: How to assign backgroundColor to a var in JavaScript
body: <p>seems like a simple question but I don't know JavaScript too well and my search-fu is turning up nothing relevant.</p>
  
  <p>I need to set the backgroundColor property of a textbox to a value set as a String in a var, like so:</p>
  
  <pre><code>var pinColor = someFunctionThatReturnsString();
  document.getElementById("pin").style.backgroundColor = pinColor;
  </code></pre>
  
  <p>If I put a literal there instead of a var, like '#ffff00', then it works fine.  However a var with the String value '#ffff00' does not work (causes no error but does not set the background either).  I have to use a var for the assignment because the information is coming from somewhere else, but I can't figure out how to make the backgroundColor respect a String value.  Is there some conversion I have to do?</p>
  
  <p>Thank you!</p>