Javascript – How to clear a plain HTML form after onsubmit

htmljavascript

After the onsubmit event has fired and the form has been submitted (via an action="mailto:yournamehere@somebox.com") , is there a way to then clear the form, close the window or what? Is there a post submit that I can hook into via JavaScript. This must be a client side only solution.

Best Answer

A quick and easy solution:

<form action="mailto:email@email.com"
    onsubmit="this.submit(); this.reset(); return false;">