title: Toggling the background color of buttons
body: <p>I have this portion of code which is intended to changed the color of input button every time I click it.</p>
  
  <pre><code>function colorchange(id) 
   {
     if(document.getElementById(id).style.background == '#FFFFFF')
    {
     document.getElementById(id).style.background = '#000000';
    }
   else
    {
     document.getElementById(id).style.background = '#FFFFFF';
    }
   }
  
  &lt;input type="button" id="k777" onclick="colorchange('k777');" style="background:#000000;"/&gt;
  </code></pre>
  
  <p>However this does not work properly.
  It does change the color of the button from #000000 to #FFFFFF the first time I click it, but when I click it again it does not change back to #000000. It's still white.
  How do I fix this?</p>