radio check event jquery code example
Example 1: radio button onchange jquery
$('input[type=radio][name=bedStatus]').change(function() {
if (this.value == 'allot') {
alert("Allot Thai Gayo Bhai");
}
else if (this.value == 'transfer') {
alert("Transfer Thai Gayo");
}
});
Example 2: if radio checked jquery
$('#element').click(function() {
if($('#radio_button').is(':checked')) { alert("it's checked"); }
});
Example 3: jQuery check a radio button
$("#myRadioID").prop("checked", true);
$("#myRadioID").attr('checked', 'checked');