Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Radio name Property

Radio name Property

Radio Object Reference Radio object


Definition and Usage

The name property sets or returns the name of the radio button.

**Tip:** Radio button groups defined using the name attribute (radio buttons with the same name belong to the same group).

The name attribute is used to send data to the server after form submission, or to reference form data in JavaScript.

Note: After form submission, only the name attribute of form elements is used to pass data values.

Syntax

Set the name attribute:

radioObject.name="

name

"

Return the name attribute:

radioObject.name


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.


Example

Example

Display the value of the name attribute of the "Red" radio button:

Runoob Tutorial(runoob.com)

Which color do you prefer?

Red

Blue

Green

Try it »


Radio Object Reference Radio object