Edit: I changed my original answer to this thanks to Dave's comment. It looks like he also posted the answer while I changed my answer, so he deserves an “accepted” answer.
Resetting a form resets the original values ​​of all fields in the form. If there was no value, it will clear the field; if there is a value, it will return the "reset" field to this value.
When you clear a form, you essentially remove ALL values ​​from the form. JavaScript doesn’t have a “crisp” function, so you have to go through each field and clear them manually.
To answer your question, you just want to "reset" the form using the reset () function, not clear the form.
source share