title: Clear echo and post in JS
body: <p>I have a problem with a php calculator application. I wanted to make something like this: </p>
  
  <p>When the results appear and I hit the reset button,  the reset function should not apply just to HTML, but to the result echo, too.  </p>
  
  <p>I don't want the page to be refreshed.  </p>
  
  <p>Here is some code:</p>
  
  <pre><code>&lt;form method="POST"&gt;
  
  &lt;input type="number" name="fn"&gt;&lt;/input&gt;
  &lt;select name="operation"&gt;
  &lt;option value="p"&gt;+&lt;/option&gt;
  &lt;option value="mi"&gt;-&lt;/option&gt;
  &lt;option value="mu"&gt;*&lt;/option&gt;
  &lt;option value="d"&gt;/&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="number" name="sn"&gt;&lt;/input&gt; &lt;br/&gt;
  &lt;input type="submit" name="sub"&gt;&lt;/input&gt;
  &lt;input type="reset" name="restart"&gt;&lt;/input&gt;
  
  &lt;/form&gt;
  
  &lt;?php 
  if (isset($_REQUEST['sub'])) {
  
  
  if($_REQUEST["operation"] == "p") {
  $fn = $_REQUEST["fn"];
  $sn = $_REQUEST["sn"];
  
  $res = $fn + $sn;
  
  ob_start();
  $restring = "The result of " . $fn . " + " . $sn . " is: " . "&lt;b&gt;" . $res . "&lt;/b&gt;";
  echo $restring;
  
  if(isset($_REQUEST["restart"])) {
  global $restring;
  ob_end_clear();
  }
  }
  
  
  
  if($_REQUEST["operation"] == "mi") {
  $fn = $_REQUEST["fn"];
  $sn = $_REQUEST["sn"];
  
  $res = $fn - $sn;
  
  echo "The result of " . $fn . " - " . $sn . " is: " . "&lt;b&gt;" . $res . "&lt;/b&gt;";
  
  }
  
  
  
  if($_REQUEST["operation"] == "mu") {
  $fn = $_REQUEST["fn"];
  $sn = $_REQUEST["sn"];
  
  $res = $fn * $sn;
  
  echo "The result of " . $fn . " * " . $sn . " is: " . "&lt;b&gt;" . $res . "&lt;/b&gt;";
  
  }
  
  
  
  
  if($_REQUEST["operation"] == "d") {
  $fn = $_REQUEST["fn"];
  $sn = $_REQUEST["sn"];
  
  $res = $fn / $sn;
  
  echo "The result of " . $fn . " / " . $sn . " is: " . "&lt;b&gt;" . $res . "&lt;/b&gt;";
  
  }
  
  }
  ?&gt;
  </code></pre>