following function should write a value on my html page:
function f(){
var aa;
aa = document.getElementById("a");
document.getElementById('resultarea').innerHTML += aa;
}
It works, but the value appears only for a few milliseconds. Then the value is gone. What is the problem? Why do my page a reset?
html code:
   <div>
  <form>
     <label for="a">a:</label>
     <input type="number" name="a" id="a" />
     <button onclick="f()">Calculate</button>
  </form>
</div>
<div id="resultarea"></div>
 
    