Clear input fields on form submit
You can clear out their values by just setting value to an empty string:
var1.value = '';
var2.value = '';
Use the reset function, which is available on the form element.
var form = document.getElementById("myForm");
form.reset();