Reset/clear a form


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Change #myform by your form id
  2.  
  3. $(':input','#myform')
  4. .not(':button, :submit, :reset, :hidden')
  5. .val('')
  6. .removeAttr('checked')
  7. .removeAttr('selected');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.