xxxxxxxxxx
$("#radio_1").prop("checked", true);
xxxxxxxxxx
$("input:radio[name=type]").click(function() {
alert('You clicked radio!');
alert($('input:radio[name=type]:checked').val());
if($('input:radio[name=type]:checked').val() == "walk_in"){
}
});
xxxxxxxxxx
$('#radio-button-id').click(function() {
if($('#radio-button-id').is(':checked'))
{
//input where you put a value
$('#program').val("radio-button-text");
}
});
xxxxxxxxxx
$(function() {
var $radios = $('input:radio[name=gender]');
if($radios.is(':checked') === false) {
$radios.filter('[value=Male]').prop('checked', true);
}
});
xxxxxxxxxx
$('input:radio[name="postage"]').change(function(){
if ($(this).val() == 'Yes') {
//true
}
else {
//false
}
});
jQuery radio button is checked false
xxxxxxxxxx
$("#radio_1").prop("checked", false);
xxxxxxxxxx
$('input:radio[name=sex]:nth(0)').attr('checked',true);
or
$('input:radio[name=sex]')[0].checked = true;
xxxxxxxxxx
// Assuming you have a radio input element with the class 'myRadio'
var selectedValue = $('input[name="myRadio"]:checked').val();