jquery reset的正确用法

转载自:http://blog.csdn.net/a437629292/article/details/38561343

[html]  view plain  copy
  1. <form id="test">  
  2. <input type="text" />  
  3. </form>  

重置表单的方法:

错误写法:

[html]  view plain  copy
  1. $('#test').reset();  

这也是在JS里的正确写法,但是在jquery里却不能这么用,要注意

正确用法:

[html]  view plain  copy
  1. $('#test')[0].reset();  

猜你喜欢

转载自blog.csdn.net/qq_37150783/article/details/79602819