Most of the time, a radio button within a group of radio buttons is check or selected and is the default. Sometimes you don't want to make a default radio button selected.
The most commonly suggested way to see if ANY radio button, in a group of radio buttons with the same name, is checked is to loop through each of the radio buttons and testing to see if the radio button is checked ...
A slightly shorten and less code intensive method of checking to see if ANY radio button, within a group of radio buttons, is checked ...
Since only one radio button, within a group of radio buttons, can be checked or selected, there is no need to run code for else
other than for testing purposes.
Here is a group of radio buttons. None of them are selected by default so this forces the visitor of your web page to make a selection of one of the radio buttons so we know the selection of a radio button is not merely because of oversight.
Select your age range: