Help Center

Local Navigation

Object: HTMLOptionsCollection

Availability

BlackBerry® Device Software version 4.6 or later

Extends

HTMLElement

The HTMLOptionsCollection object contains an array of HTMLOptionElement objects.

You can access an individual option element within a collection by its index position using HTMLOptionsCollection.item(), by its name or id attribute using HTMLOptionsCollection.namedItem(), or you can index the object directly. For example, if you create an instance of a HTMLOptionsCollection object called myHTMLOptions, then specifying

myHTMLOptions.item(2)

myHTMLOptions.namedItem(“item”)

is equivalent to specifying

myHTMLOptions[2]

myHTMLOptions[“item”]

HTMLOptionsCollection properties

Property name

Type

Description

Status

Support level

Availability

length

int

Returns the number of HTMLOptionElement objects contained in the list.

read only

DOM 2 HTML

4.6 or later


Was this information helpful? Send us your comments.