Also, how can I retrieve a value using reset function?
Clear vs. Reset
Clearing a form makes all input fields blank, unchecks checkboxes, deselects multi-select choices, and so forth; whereas, resetting a form reverts all changes.
<input type="text" name="name" value="Timothy" /> <input type="reset" value="Reset" />
This produces an input field with a value of Timothy. Let's say the user then changes the value to Berners-Lee. If the user clicks the
Reset button, the value of Berners-Lee will revert (reset) to Timothy.
Clearing the fields would involve changing the
value attribute of the input field to the empty string, as follows:
<input type="text" name="name" value="" />
You can change the