Help Center

Local Navigation

Object: HTMLOptionElement

Availability

BlackBerry® Device Software version 4.6 or later

Extends

HTMLElement

The HTMLOptionElement object represents an <option> element in an HTML document.

The <option> element encloses the text of an option in a selection list.

HTMLOptionElement properties

Property name

Type

Description

Status

Support level

Availability

defaultSelected

boolean

When true, indicates that the option is selected by default.

writable

DOM 2 HTML

4.6 or later

disabled

boolean

When true, indicates that the option is not available.

writable

DOM 2 HTML

4.6 or later

form

HTMLFormElement

Returns the form that contains the option. If this element is not contained by a form, this property returns null.

read only

DOM 2 HTML

4.6 or later

index

int

Returns the position of this option within the parent <select> element.

read only

DOM 2 HTML

4.6 or later

label

DOMString

Specifies a label for the option.

writable

DOM 2 HTML

4.6 or later

selected

boolean

When true, indicates that the option is currently selected.

writable

DOM 2 HTML

4.6 or later

text

DOMString

Specifies the text contained within the <option> element.

writable

DOM 2 HTML

4.6 or later

value

DOMString

Specifies the value of the option that is sent to the server when the form is submitted.

writable

DOM 2 HTML

4.6 or later


Was this information helpful? Send us your comments.