How to change radio button to 'checked' when another is selected?
问题 I hope you guys can help me with this one. How can I have a radio button id="A" change it's attribute to 'checked' when radio button id="B" is selected? Radio buttons A and B are in different groups. Thanks! 回答1: <input type="radio" name="group1" id="A">Radio A <input type="radio" name="group2" id="B">Radio B <input type="radio" name="group2" id="C">Radio C $("input[type='radio'][name='group2']").change(function() { if ($('#B').is(':checked')) { $('#A').prop("checked", true); } else { $('#A')