title: Prevent form submission in the onsubmit event
body: <p>In my project, I have JS and HTML code as following:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
  function myFunction() {
      //document.getElementById('demo').innerHTML = Date();
      alert("done");
      var a = parseInt(document.getElementById('number1').value);
      var b = parseInt(document.getElementById('number2').value);
      var c = a + b;
      $.get('/_add_numbers',{number: c}, function(data,status){
          res = JSON.parse(data);
          alert(status);
          $("#feedback").text("change");
          alert("show");
      });
  };
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;My First JavaScript V2&lt;/h1&gt;
  &lt;p id="demo"&gt;&lt;/p&gt;
  &lt;form onsubmit="myFunction()"&gt;
      &lt;input type="text" size="5" name="a" id = "number1"&gt; +
      &lt;input type="text" size="5" name="b" id = "number2"&gt; =
      &lt;span id="result"&gt;?&lt;/span&gt;
      &lt;br&gt;
      &lt;input type="submit" value="calculate server side" &gt;
  &lt;/form&gt;
  &lt;p id="feedback"&gt;feedback&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>And the alert shows that the status was success.</p>
  
  <p>The content of the paragraph turns to "change", but finally change back to original "feeback". So what's the reason ?</p>