Radio buttons
When you wish for only one option to be selected, you can use radio buttons. This requires the introduction of yet another attribute: the name attribute (name
) assigns the same value to all related radio buttons.
Each radio button is an input element with a type attribute of value radio
and a name attribute of value matching all related buttons, so that only one with that name value can be chosen.
Like for checkboxes, the value input attributeAn attribute of an input element specifying information depending on the type of input, such as text for a button or a value used by JavaScript for a checkbox. attaches a value to a radio button that can be used by JavaScript. In the JavaScript lesson on radio buttons, you can see this example in action.
Note:
Hints:
- undefined