HTML DOM Radio Object
Radio Object
The Radio object represents a radio button in an HTML form.
In an HTML form, A Radio object is created each time the tag appears.
A radio button represents one of a group of mutually exclusive option buttons. When one button is selected, the previously selected button becomes unselected.
When a radio button is selected or deselected, it triggers the onclick event handler.
You can access the Radio object by iterating over the elements[] array of the form, or by using document.getElementById().
Radio Object Properties
W3C: W3C standard.
| property | Description | W3C |
|---|---|---|
| checked | Sets or returns the state of the radio button. | Yes |
| defaultChecked | Returns the default state of the radio button. | Yes |
| disabled | Sets or returns whether the radio button is disabled. | Yes |
| form | Returns a reference to the form containing 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
The Radio object also supports the standard property and Events.