INPUT TYPE=checkbox XHTML Element

Send Feedback

The INPUT TYPE=checkbox element creates a check box control. This is an inline element and does not require a closing tag.

Using this Element

There are some common properties and collections that apply to all the elements of the document object model, see Common Properties for All DOM Elements in Internet Explorer Mobile.

This element can be used within a web page with attributes.

This element can be used within scripts where it will have properties, events and methods.

Attributes

Attribute Value PPC SP Description
ACCESSKEY 0...9, #, * Yes Yes Gives access or focus to an active HTML element by using a keypad number.
Note   For Pocket PCs, supported only for devices running Windows Mobile 2003 software or later.
CHECKED   Yes Yes Specifies selection of the checkbox control.
CLASS   Yes Yes Associates the element with a CSS style.
Note   Supported only for devices running Windows Mobile 2003 software or later.
DISABLED   Yes Yes Disables the check box so that it appears dimmed and does not respond to user input.
Note   Supported only for devices running Windows Mobile 2003 software or later.
ID   Yes Yes Uniquely identifies the element within a document.
Note   Supported only for devices running Windows Mobile 2003 software or later
NAME String Yes Yes Specifies the check box control name, which is submitted along with the check box control value, when it is selected.
ONBLUR   Yes Yes Event that occurs when the check box element loses focus by the pointing device or by tabbing navigation.
Note   Supported only for devices running PocketPC 2002 and Smartphone 2002 software or later.
ONCLICK   Yes Yes Event that occurs when the user chooses the check box control.
Note   Supported only for devices running PocketPC 2002 and Smartphone 2002 software or later.
ONFOCUS   Yes Yes Event that occurs when the check box control receives focus by a pointing device or by tabbing navigation.
Note   Supported only for devices running PocketPC 2002 and Smartphone 2002 software or later.
STYLE   Yes Yes Provides the definition of the CSS styles used for this element.
Note   Supported only for devices running Windows Mobile 2003 software or later.
TABINDEX   Yes Yes Sets the order in which elements are tabbed to.
Note   Supported only for devices running Windows Mobile 2003 software or later.
VALUE String Yes Yes Specifies the check box control value, which is submitted along with the check box control name, when it is selected.

Scripting Properties

Property Type Access Comments
accessKey string Read/Write  
checked boolean Read/Write Sets or retrieves the state of the input type=checkbox control. The only possible values are true and false.
disabled boolean Read/Write  
defaultChecked boolean Read Only Specifies whether the input type=checkbox is checked by default.
form   Read Only  
name string Read Only  
type string Read Only Always returns: checkbox
value string Read/Write Sets or retrieves the value of the input type=checkbox.

Scripting Events

Event Supported Comment
onclick Yes This event fires when the user taps on the checkbox element. Note the event only fires if the user does a pen down while on the checkbox and a pen up over the same checkbox. The author can specify special handler for this event.
onblur Yes  
onfocus Yes  

Scripting Methods

Method Support Comments
click Yes Syntax:

checkbox.click()

  • Simulates clicking on the checkbox causing the onclick event to fire.
focus Yes Syntax:

checkbox.focus()

  • Sets focus to the checkbox.

Requirements

Pocket PC: Windows Mobile 5.0 and later
Smartphone: Windows Mobile 5.0 and later
OS Versions: Windows CE 5.01 and later

See Also

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.