I have a form with textareas,texts,checkboxes and buttons. I select elements as below:
$("#frmPersonalInfo :input:not(input[type=radio]):not(input[type=button])").each(function(){
//code here
});
When I omit the not(input[type=radio]) then radio elements are being selected. I want to select the radio that has been checked (the active one) not all radio inputs. Is there a way to do this?
Radio HTML code is as follow:
<input type="radio" checked="checked" id="txtPersonalInfoMale" name="gender" value="1" />
<input type="radio" id="txtPersonalInfoFemale" name="gender" value="2" />
this might not be the best method but the below should work