What Are HTML Radio Buttons?
In some aspects, HTML radio buttons are similar to HTML checkboxes. Each button is assigned an image or text label that is displayed where the button is located within a layout. Next to this label is a circle that is empty when the radio button is not selected and has a dot or other fill pattern inside it when it is selected. A user can click on the circle to select it; the unique aspect of HTML radio buttons is that, when a button is selected, all other buttons in the same group are de-selected, allowing only one item to be chosen at a time. This is unlike checkboxes, which are similar but allow any number of options to be selected at once.
There are two values within the properties of HTML radio buttons that are important to their use. The first is the name field that identifies the group to which a radio button belongs within an HTML document, and the second is the value field. When a button is selected, all other radio buttons with the same name, also called their group, are deselected. Using different group names allows different sets of radio buttons to exist within the same document. The value tag is the actual return value for the radio button when it is selected and submitted to a script or program for processing.
Discuss this Article
Post your comments