Alex Rivera | Logout

How to uncheck a radio button?

Asked 2010-01-22T13:42:58.817
558

I have group of radio buttons that I want to uncheck after an AJAX form is submitted using jQuery. I have the following function:

function clearForm(){
  $('#frm input[type="text"]').each(function(){
      $(this).val("");  
  });
  $('#frm input[type="radio":checked]').each(function(){
      $(this).checked = false;  
  });
 }

With the help of this function, I can clear the values at the text boxes, but I can't clear the values of the radio buttons.

By the way, I also tried $(this).val(""); but that didn't work.

Edit
Report

1 Answer

12

Try

$(this).attr("checked" , false );
answered 2010-01-22T13:47:03.020

Your Answer