title: How to stay on same page after click "submit" button, and keep the date I entered in JavaScript
body: <ol>
  <li>After clicking "submit", stay on this page.</li>
  <li>Input data, like "computer number" and "profit", stay inside those blank square.</li>
  <li>A word "Submitted", appear in the center of this page. </li>
  </ol>
  
  <p>The following is my code,
  Please help, thank you!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  
    &lt;body&gt;
  
    &lt;form name="my form" 
  onsubmit="return validateForm()"&gt;
     
      Computer Number:&lt;br&gt;
      &lt;input type="text" name="Computer" required&gt;&lt;br&gt;
    
  &lt;p&gt;How much is your profit?                                 
  
  &lt;input id="id1" name = "id1" required&gt;
    &lt;button  type = "button" onclick="myFunction()"&gt;Check My Answer&lt;/button&gt; 
      &lt;button type="button" id="btn1" onclick="Solution()" style="display:none;"&gt;Solution&lt;/button&gt;
      &lt;/p&gt;
  
  &lt;p id="Q1"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  var errosCount = 0;
    function myFunction() {
      var x, text;
      x = document.getElementById("id1").value;
     
      if (isNaN(x) || x != 100) {
          text = "Incorrect"; document.getElementById("Q1").style.color = "red";errosCount++;
      } else {
          text = "Correct"; document.getElementById("Q1").style.color = "green";
      }
      document.getElementById("Q1").innerHTML = text;
           if(errosCount === 3){
          errosCount = 0;
          document.getElementById('btn1').style.display = 'block';
          document.getElementById("Q1").innerHTML = '';
        } else {
          document.getElementById('btn1').style.display = 'none';        
        } 
  }
  function Solution(){
    text = "(P - w) * q&lt;sub&gt;o&lt;/sub&gt; - I = (53 - 43) * 30 - 200 = 100";  document.getElementById("Q1").style.color = "red";
    document.getElementById("Q1").innerHTML = text;
  }      
  &lt;/script&gt;
   
    &lt;input type="submit" value="Submit"&gt;
    
  &lt;/form&gt;
    
    &lt;script&gt;
  function validateForm() {
      var q = document.forms["my form"]["Computer"].value;
      if (q == "") {
          alert("Computer Number is Missing!");
          return false;}
    var w = document.forms["my form"]["id1"].value;
      if (w != "100") {
          alert("Question 1 is Incorrect!");
          return false;}
    
  }
  &lt;/script&gt;
     
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>