title: onClick function causes refresh on Chrome
body: <p>I've come across a very bizzare behavior on my Chrome. The following code causes the page to be refreshed on Chrome when I click on the add button which is not what I want it to do:</p>
  
  <pre><code>function addSpamAddr() 
  {
      var email = prompt("Add Spam Address","");
      if (email == null || email == "")
          return false;
  
      var regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
      if (regex.test(email) == false) {
          alert("You must enter a valid E-Mail address");
          return false;
      }
  
  
      var listBox = document.getElementById('spamList');
      for (var x = 0; x &lt; listBox.options.length; x++) {
          if (listBox.options[x].value == email || listBox.options[x].text == email) {
              alert("Already blocked address");
              return false;
          }
      }
  
      var selectBoxOption = document.createElement("option");
      selectBoxOption.value = email;
      selectBoxOption.text = email;
      listBox.add(selectBoxOption);
  
      return false;
  }
  
  
  ...
  &lt;button style="margin-right: 20px;width:60px" onclick="addSpamAddr()"&gt;Add&lt;/button&gt;
  </code></pre>
  
  <p>The code works perfectly fine on Internet Explorer. I've created a minimal example to further investigate the issue:</p>
  
  <pre><code>function addSpamAddr()
  {
     return false;
  }
  ...
  &lt;button style="margin-right: 20px;width:60px" onclick="addSpamAddr()"&gt;Add&lt;/button&gt;
  </code></pre>
  
  <p>Still causes refresh on Chrome.</p>
  
  <p>How can I prevent the refresh?</p>
  
  <p>Edit: After I added the return statement inside the onclick event, the page no longer refreshes on the minimal example I created.</p>
  
  <pre><code>&lt;button style="margin-right: 20px;width:60px" onclick="return addSpamAddr()"&gt;Add&lt;/button&gt;
  </code></pre>
  
  <p>However, the page would still refresh if I apply my original code. Particularly, this part causes it:</p>
  
  <pre><code>    var listBox = document.getElementById('spamList');
      var exists = false;
      for (var x = 0; x &lt; listBox.options.length; x++) {
          if (listBox.options[x].value == email || listBox.options[x].text == email) {
              alert("Already blocked address");
              return false;
          }
      }
  </code></pre>
  
  <p>How do I fix this?</p>