title: onclick does not work properly in firefox
body: <p>I have a line of code that changes body background to black when particular img link is clicked, and if the img link is clicked again it returns to white. It works perfect in chrome, but in firefox it works for the first click but does not change back body background on second click. Here is the code:  </p>
  
  <p>HTML  </p>
  
  <pre><code>&lt;a href="#" onclick="changeBackground('black');return false;"&gt;&lt;img class="img1"  src="..."&gt;&lt;/img&gt;&lt;/a&gt;  
  </code></pre>
  
  <p>JAVASCRIPT  </p>
  
  <pre><code>       &lt;script type = "text/javascript"&gt;
              function changeBackground(color) {
                  if(document.body.style.background != 'black'){
                  localStorage.color = document.body.style.background = color;
                  }
                  else if(document.body.style.background === 'black'){
                  localStorage.color = document.body.style.background = 'white';
                  }           
                  changeBackground(localStorage.color);
              };
        &lt;/script&gt;  
  </code></pre>
  
  <p>I assume that this is not problem with onclick trigger because it works in firefox for the first click. It may be the javascript code..but I don't see anything missing...</p>