` in an HTML form creates a"> ` in an HTML form creates a" />
Easy Tutorial
❮ Prop Img Hspace Jsref Encodeuri ❯

HTML DOM


Radio Object

The Radio object represents a radio button in an HTML form.

Each occurrence of <input type="radio"> in an HTML form creates a Radio object.

A radio button represents one of a set of mutually exclusive option buttons. When one button is selected, any previously selected button becomes deselected.

When a radio button is selected or deselected, the button triggers the onclick event handler.

You can access the Radio object by traversing the form's elements[] array 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 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 Attributes and Events

The Radio object also supports standard attributes and events.

❮ Prop Img Hspace Jsref Encodeuri ❯