title: Changing background-color of a button using 1 javascript
body: <p>I want to change the background-color of my button.
  This is my code so far:</p>
  
  <pre><code>&lt;script&gt;
  function setColor(btn) {
      var property = document.getElementById(btn);
      if (property.style.backgroundColor == "rgb(127, 255, 0)") {
          property.style.backgroundColor = "rgb(255, 0, 0)"  
      }
      else if(property.style.backgroundColor == "rgb(255, 0, 0)")
      {
          property.style.backgroundColor = ""
      }
      else {
          property.style.backgroundColor = "rgb(127, 255, 0)"
      }
  }
  &lt;/script&gt;
  
  &lt;input type="button" id="button" value = "button" onclick="setColor('button')";/&gt;
  </code></pre>
  
  <p>This works with one button. If I have multiple buttons it only change the first button color. How can I change the color of every button with this JavaScript?</p>