how to uncheck radio button in jquery code example
Example 1: get value of checked radio button jquery
$('form input[type=radio]:checked').val();
Example 2: check radio button is checked jquery
$(document).ready(function(){
$('#submit_button').click(function() {
if (!$("input[name='name']:checked").val()) {
alert('Nothing is checked!');
return false;
}
else {
alert('One of the radio buttons is checked!');
}
});
});
Example 3: unset radio button jquery by name
$("input:radio[name='thename']").each(function(i) {
this.checked = false;
});
Example 4: uncheck all radio button jquery
$('.classname').prop('checked', false);
Example 5: radio button unchecked html jquery
$(this).prop('checked', false);