<input> - radio
HTML DOM Radio object
Radio Object
A Radio object represents a radio button in an HTML form.
Each time <input type="radio"> appears in an HTML form, a Radio object is created.
A radio button is one of a set of buttons that represent mutually exclusive options. When a button is selected, the previously selected button becomes unselected.
When the radio button is checked or unchecked, the button fires the onclick event handler.
You can access the Radio object by iterating over the form's elements[] array, or by using document.getElementById().
Radio Object Properties
W3C: W3C standard.
Attribute | Description | W3C |
---|---|---|
checked | Sets or returns the status of the radio button. | Yes |
defaultChecked | Returns the default state of the radio button. | Yes |
disabled | Sets or returns whether to disable the radio button. | Yes |
form | Returns a reference to the form that contains this radio button. | Yes |
name | Sets or returns the name of the radio button. | Yes |
type | Returns the form type of the radio button. | Yes |
value | Sets or returns the value of the value attribute of the radio button. | Yes |
Standard Properties and Events
Radio objects also support standard properties and events .