js reset form with requered code example Example: javascript reset form document.querySelector("form").reset();