Currently I have:
$("#your_email").val(this.defaultValue;)
I want to be cycling through all form elements and resetting them to their default value
Currently I have:
$("#your_email").val(this.defaultValue;)
I want to be cycling through all form elements and resetting them to their default value
Share Improve this question edited Aug 31, 2010 at 15:40 user113716 322k64 gold badges453 silver badges441 bronze badges asked Aug 31, 2010 at 15:01 kalpaitchkalpaitch 5,27110 gold badges45 silver badges69 bronze badges 4 |1 Answer
Reset to default 23you don't need jQuery for this, just get the form dom element and call reset() on it.
Or, fetch with jQuery like:
$("#myFormId")[0].reset();
this.defaultValue
implies a native solution. – user113716 Commented Aug 31, 2010 at 15:41