<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.

AttributeDescriptionW3C
checkedSets or returns the status of the radio button.Yes
defaultCheckedReturns the default state of the radio button.Yes
disabledSets or returns whether to disable the radio button.Yes
formReturns a reference to the form that contains this radio button.Yes
nameSets or returns the name of the radio button.Yes
typeReturns the form type of the radio button.Yes
valueSets 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 .