How to Reset a Form Using Javascript

<form>
<input type="button" onclick="document.forms[0].reset()" value="Reset This Form">
</form>

It doesn’t clear the data, it just resets all form values to their original value. Here’s a demo:

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">