In development, we will use a lot of forms, we want to submit the form after the reset,
But jquery does not have this method, how to deal with it?
Copy Code code as follows:
<form id= "Form1" action= "method=" POST "runat=" Server ">
<input name= "INP" id= "INP" value= "1"/>
</form>
Method One:
We can do this by just realizing
Id:
Copy Code code as follows:
document.getElementById ("Form1"). Reset ();
Name
Copy Code code as follows:
Document.formName.reset ();
Method Two:
Empty each:
Copy Code code as follows:
But the form is too many words, this is also impractical, there are 100, 1000, can not write 100, 1000.
Perhaps you would say, written like this:
Copy Code code as follows:
What about the default value of the form? What other types of forms do you write?
Add type to reset input
Copy Code code as follows:
<form id= "Form1" action= "method=" POST "runat=" Server ">
<input name= "INP" id= "INP" value= "1"/>
<input id= "res" name= "res" type= "reset" style= "Display:none"/>
</form>
Copy Code code as follows:
$ ("Input[name= ' res ']"). Click ();
All Forms Empty
Ok