Answers for "set form empty jquery"

0

set form empty jquery

$('#formId')[0].reset();
OR 
// For jQuery 1.6+:
$(':input','#formId')
  .not(':button, :submit, :reset, :hidden')
  .val('')
  .prop('checked', false)
  .prop('selected', false);

// For jQuery < 1.6:
$(':input','#formId')
  .not(':button, :submit, :reset, :hidden')
  .val('')
  .removeAttr('checked')
  .removeAttr('selected');
Posted by: Guest on June-29-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language