title: Onclick not creating permanent change
body: <p>I am writing a code with multiple divs that uses a button to change the background colors of divs when clicked. The background of the divs are hard coded into the html:
  ex:</p>
  
  <pre><code>&lt;div style="background-color: grey"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I click the button, I want the background color to be permanently changed to white. However, the color only changes to white for an instant. the code is as such:</p>
  
  <pre><code>&lt;script&gt;
      var divs=document.getElementsByTagName("div");
      function noColors(){
          for(i=0;i&lt;divs.length;i++){
          divs[i].style.backgroundColor="white";
          }
      };
  &lt;/script&gt;
  &lt;form&gt;
      &lt;button onclick="noColors()"&gt; I HATE THESE COLORS!!! &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Any help would be appreciated</p>