The submission form is like this: the Code $ (' #myform '). Submit () $ (' #myform '). Submit () So, take it for granted that resetting the form is, of course, like this: code $ (' #myform '). Reset () $ (' # MyForm '). Reset () However, unfortunately, there will be a depressing result for you, that is, the form cannot be reset! Later, on the Internet to check, that is, jquery did not reset method, after checking, sure enough is not. Is there no way to reset the form with jquery, the answer is, it's just an indirect approach, as follows: The code $ (' #myform ') [0].reset ()] is the reset form by invoking the Reset method in the DOM. I've already used two types of resets myself: //$ (": Reset") Select all the reset buttons
$ (": Reset"). Click (function () {
The first: Assign values directly to NULL
$ ("#form1"). Val ("");
Second: Reset the form by calling the Reset method in the DOM
$ ("#form1" [0].reset ();
});
My form:
<form id= "Form1" >
<input Type= "Reset"/>
</form>
The Reset in jquery