- Is it better to use the onclick or onchange event for radio buttons?
- How do you get the value of the selected radio button in a group?
- How do you get the value of a radio button onclick?
- How do you find out if the selected radio button is the one checked by default?
Basic Facts about Radio Buttons
Radio buttons are set up in groups with each one having the same name as others in the group. Only one radio button in a group can be selected at a time. When another radio button in the group is clicked to select it, the previously selected one is deselected. Typical uses for radio buttons involve choices that are mutually exclusive, such as gender or shipping method.
value properties. The
onclick event will generally be favored over
onchange. Find out why at Onclick vs. Onchange.