jquery chek radio 1

jquery chek radio

// jQuery version 1.6 or above use:  
$("#myRadioID").prop("checked", true);
 
//jQuery versions below 1.6 use:
$("#myRadioID").attr('checked', 'checked');

Here is what the above code is Doing:
1. First, we select the radio button with jQuery using the ID selector.
2. Then, we use the prop() function to set the checked property to true.
3. Finally, we use the attr() function to set the checked attribute to checked.

Similar Posts