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

HTML DOM Checkbox name attribute

Checkbox name attribute

Checkbox Object Reference Checkbox Object


Definition and Usage

The name attribute sets or returns the value of the checkbox element's name attribute.

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:

checkboxObject.name="

name

"

Return the name attribute:

checkboxObject.name


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.


Example

Example

The example below outputs the name of the checkbox:

Runoob Tutorial(runoob.com)

Do you like summer?

Try it »


Checkbox Object Reference Checkbox Object