Change Language


Follow Navioo On Twitter

Checkbox : HTMLElement

A box that the user can check. For groups of checkboxes, users may select multiple checkboxes.

Platform Support

IE Mozilla Netscape Opera Safari
3.0+ 1.0+ 2.0+ 7.0+ 1.0+

Constructors

Constructor Action IE Mozilla Netscape Opera Safari
Checkbox Constructor() : Checkbox
Creates a new instance of a Checkbox object.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+

Checkbox() : Checkbox

Creates a new instance of a Checkbox object.

Returns

Checkbox
Visibility
internal

Inherited Properties

Property Action IE Mozilla Netscape Opera Safari
onclick : Object
Event handler for when a user clicks on the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Input.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

ondblclick : Object
Event handler for when a user double-clicks the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onhelp : Object
Event handler for when a user requests Help.
Show Details 3.0+ no no no no
Availability

Internet Explorer 4

onkeydown : Object
Event handler for when a user presses a key on his or her keyboard.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onkeypress

Availability

JavaScript 1.2|HTML 4.0

onkeypress : Object
Event handler for when a user presses and releases a key on his or her keyboard.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event

Availability

JavaScript 1.2|HTML 4.0

onkeyup : Object
Event handler for when a user releases a key on his or her keyboard.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onkeydown

Availability

JavaScript 1.2|HTML 4.0

onmousedown : Object
Event handler for when a user clicks the mouse button.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onmousemove : Object
Event handler for when a user moves the mouse.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Window.captureEvents|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onmouseout : Object
Event handler for when a user moves the mouse off of the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Link.onmouseout|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

onmouseover : Object
Event handler for when a user moves the mouse over the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|Link.onmouseover

Availability

JavaScript 1.2|HTML 4.0

onmouseup : Object
Event handler for when a user releases the mouse button.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

Event|HTMLElement.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.2|HTML 4.0

all : Array
List of all elements within the current element. Behaves similarly to document.all.
No Details 4.0+ no no 7.0+ no
children : Array
The direct child elements of the current element.
No Details 4.0+ no no no no
className : String
The CSS class that the element belongs to.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

document : Object
Reference to the Document object that contains the current element.
No Details 4.0+ no no no no
id : String
Identifier used to assign a unique name to the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

innerHTML : String
HTML text that the element contains. (Does not include opening and closing tags of the element.)
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
innerText : String
Plain text that the element contains. (Does not include opening and closing tags of the element.)
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
lang : String
lang attribute of the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

offsetHeight : Object
Height (in pixels) of the element and its contents.
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
offsetLeft : Object
Horizontal position (in pixels) of the element relative to the offsetParent container element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
See Also

offsetParent

offsetParent : Object
Container element used as a reference for the offsetLeft and offsetTop elements.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
See Also

offsetLeft|offsetTop

offsetTop : Object
Vertical position (in pixels) of the element relative to the offsetParent container element.
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
offsetWidth : Object
Width (in pixels) of the element and its contents.
No Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
outerHTML : String
HTML text that the element contains, including its start and end tags.
No Details 4.0+ no no 7.0+ no
outerText : String
Plain text that the element contains, including its start and end tags.
No Details 4.0+ no no 7.0+ no
parentElement : Object
Element that is the direct parent of the current element.
No Details 4.0+ no no no no
sourceIndex : Object
Index of the current element in document.all.
No Details 4.0+ no no no no
style : Object
Inline CSS style attributes for the element.
No Details 4.0+ 1.0+ 4.0+ 7.0+ 1.0+
tagName : String
HTML tag name for the element.
No Details 5.5+ 1.0+ 6.0+ 7.0+ 1.0+
title : String
Title attribute of the HTML tag for the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+
Availability

W3C

Properties

Property Action IE Mozilla Netscape Opera Safari
static onclick : Function
Event handler for when the checkbox is clicked.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
See Also

HTMLElement.onclick|EventListener|EventTarget|MouseEvent

Availability

JavaScript 1.0

checked : Boolean
Returns true if the checkbox is checked. False if the checkbox is not checked.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
defaultChecked : Boolean
Returns true if the checkbox is checked by default.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+
value : String
Specifies a string value for when the checkbox is checked.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+

Inherited Functions

Method Action IE Mozilla Netscape Opera Safari
contains(Object target) : Boolean
Determines whether the current element contains the target HTML element.
Show Details 4.0+ no no no no

Parameters

Object target The HTML element that the element is to be compared with.

Returns

Boolean
Availability

Internet Explorer 4

getAttribute(String name) : String
Gets the value of the specified attribute.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+

Parameters

String name Name of the attribute.

Returns

String
Availability

handleEvent() : Object
Calls the event handler for the specified event.
Show Details no no 6.0+ no no

Returns

Object
See Also

window.handleEvent|document.handleEvent

insertAdjacentHTML(String where, Object text) : void
Inserts HTML text in the specified location within or next to the element.
Show Details 5.0+ no no 7.0+ no

Parameters

String where Specifies where the HTML text should be inserted.
Object text The HTML text to insert.

Returns

void
insertAdjacentText(String where, Object text) : void
Inserts plain text in the specified location within or next to the element.
Show Details 5.0+ no no 7.0+ no

Parameters

String where Specifies where the text should be inserted.
Object text The plain text to insert.

Returns

void
removeAttribute(String name) : Attribute
Deletes the specified attribute from the element.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+

Parameters

String name Name of the attribute to be removed.

Returns

Attribute
scrollIntoView([Boolean top]) : void
Scrolls the current document so that the top of current element is either at the top of the display area, or the bottom of the element is at the bottom of the display area.
Show Details 4.0+ 1.0+ 7.0+ no no

Parameters

Boolean top (optional)Specify false to align the bottom of the element with the bottom of the display area. Specify true or nothing to align the top of the element with the top of the display area.

Returns

void
setAttribute(String name, Object value) : Object
Sets the specified attribute to the specified value for the element.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+

Parameters

String name Name of the attribute.
Object value Value of the attribute to set.

Returns

Object
Availability

HTML DOM Level 1

References

Form|HTMLElement|Input|Radio|HTMLInputElement

Availability

JavaScript 1.0|enhanced in JavaScript 1.1

text_javascript Navioo_docs

Examples -> Source code Demo online - > checkbox:

Ajax Javascript feed

↑ Grab this Headline Animator