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

HTML DOM Checkbox value attribute

Checkbox value attribute

Checkbox Object Reference Checkbox Object


Definition and Usage

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

The checkbox's value attribute value is not shown in the user interface. The value attribute is used for form data submission (only checked checkboxes pass data to the server; if nothing is selected, no checkbox data is passed).

Syntax

Set the value attribute:

checkboxObject.value="

value

"

Return the value attribute:

checkboxObject.value


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value property.


Example

Example

Display the value associated with the checkbox:

Runoob Tutorial(runoob.com)

I have a bicycle

Try it »


Checkbox Object Reference Checkbox Object