HTML <input> type Attribute
Example
<input type="radio" id="html" name="language" value="HTML">
<label for="html">HTML</label>
<input type="radio" id="css" name="language" value="CSS">
<label for="css">CSS</label>
<input type="radio" id="javascript" name="language" value="JavaScript">
<label for="javascript">JavaScript</label>
Meaning
A radio button, allowing a single value to be selected out of multiple choices with the same name value.
Related attributes:
- checked: A Boolean specifies whether or not this radio button is the default-selected item in the group.
- value: The string to use as the value of the radio when submitting the form, if the radio is currently toggled on.
- name: A String specifies group must have share the same attribute to treat as a group.
Standard Syntax
HTML: <input type="radio">
XHTML: <input type="radio" />
Advertisement