How to .reset() form with jQuery
Such jQuery call won’t work:
1 2 |
$('#formId').reset(); // error: $("#formId").reset() is not a function |
As the tutorial shows (yes, I never read manuals before I get into troubles as well, but always google answers before think, lol), we can have the following:
1 2 3 4 5 |
function resetForm(id) { $('#'+id).each(function(){ this.reset(); }); } |
…and somewhere on a page this:
1 |
<input type="button" onclick="resetForm('formId');" /> |
From: http://simple.procoding.net/2008/11/22/how-to-reset-form-with-jquery/

浙公网安备 33010602011771号