Name

Checkbox — a graphical checkbox

Availability

Client-side JavaScript 1.0; enhanced in JavaScript 1.1

Inherits From

Input, HTMLElement

Synopsis

// A single checkbox with a unique name
form.name form.elements[i]
// A group of checkboxes with the same name
form.name[i]

Properties

Checkbox inherits properties from Input and HTMLElement and also defines or overrides the following:

checked

Whether a Checkbox is checked.

defaultChecked

The initial state of a Checkbox.

value

The value returned when a form is submitted.

Methods

Checkbox inherits the methods of Input and HTMLElement.

Event Handlers

Checkbox inherits event handlers from Input and HTMLElement and also defines or overrides the following:

onclick

The handler invoked when a Checkbox is selected.

Get Webmaster in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.