I am trying to clear a form. I am trying to remove the values for text boxes then unselect radios/checkboxes but keep the values of them and hidden inputs.
I have this so far but it removes the values for my radios/checkboxes and hidden inputs.
$(':input','#form1')
.not(':button, :submit, :reset, :hidden')
.val('')
.removeAttr('checked')
.removeAttr('selected');
By calling
val(''), you already removing the content of your element’s, try this: