HTML JS
(quick guide & examples)
<form id="demo" autocomplete="off" onsubmit="return process()">
</form>
WILL RESET TO "JON" <input type="text" name="name" value="Jon">
WILL REVERT TO BLANK <input type="email" name="email">
GO! <input type="submit" value="Go!">
function process () { GET FORM DATA var f = document.getElementById("data"), d = new FormData(f);
AJAX SEND FORM fetch("URL", { method: "POST", body: d }) .then(res => res.text()) .then(txt => { console.log(txt); f.reset(); RESET FORM }); return false; }