I have tried $("#client.frm").reset();
but it is not working.So how to reset form via jQuery?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
Reset (Clear) Form throught
Javascript
&jQuery
:Example Javascript:
Example jQuery:
You may try using
trigger()
Reference LinkYou could use the following:
Use JavaScript function
reset()
:,reset() method does not clear the default values and checkbox field and there are many more issues.
In order to completely reset check the below link -
http://www.javascript-coder.com/javascript-form/javascript-reset-form.htm
You can simply do:
$("#client.frm").trigger('reset')
form.reset()
is a DOM element method (not one on the jQuery object), so you need:Or without jQuery: