title: Changing a button's background color when it's clicked
body: <p>I'm trying to change the <code>background-color</code> property of a button using JavaScript. The script checks what the current <code>background-color</code> is set to and then toggles it.
  This is the JavaScript code: </p>
  
  <pre><code>function btnColor(btn,color) {
      var property=document.getElementById(btn);
      if (property.style.background-color == "#f47121") {
          property.style.background-color=Color;
      }
      else {
          property.style.background-color = "#f47121";
      }
  }
  </code></pre>
  
  <p>and this is what I pass in html:</p>
  
  <pre><code>&lt;input type="button" id="btnHousing" value="Housing" onclick="toggleLayer('transparent1');btnColor('btnHousing','#fff200');" /&gt;
  </code></pre>
  
  <p><code>toggleLayer</code> is another function I am using, which works perfectly fine.
  I can't seem to figure out why it doesn't work. </p>