thumb|Four options on a radio button. When a new option is chosen, the previously chosen option is unselected.
A radio button or option button is a graphical control element that allows the user to choose only one of a predefined set of mutually exclusive options. When one of the buttons is pressed, the other buttons pop out while leaving the pushed one pressed in.
HTML
In web forms, the HTML element is used to display a radio button. Example:
<syntaxhighlight lang="html">
<form>
<input type="radio" name="season" value="winter" id="winter" checked>
<label for="winter">Winter</label>
<input type="radio" name="season" value="spring" id="spring">
<label for="spring">Spring</label>
<input type="radio" name="season" value="summer" id="summer">
<label for="summer">Summer</label>
<input type="radio" name="season" value="autumn" id="autumn">
<label for="autumn">Autumn</label>
</form>
</syntaxhighlight>A group of attributes is defined by name. In one group, only one radio button can be chosen.
Unicode
Version of the Unicode standard includes a character designated to represent a radio button: , found in the Miscellaneous Symbols and Pictographs section. Similar characters are the mathematical operator as well as and and others resembling a circled dot.
The font Wingdings 2 contains at position 153 and 158 glyphs that look like radio buttons.
See also
- Checkbox
References
External links
- : the HTML 2.0 specification, which defined radio buttons on the web.
- W3 HTML 4.01 Specification
- Usage of radio buttons in Sun's Java Programming Tutorial
