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”]

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

Methods

Method name

Description

Support level

Availability

item()

Retrieves a specific option node, by index, from the collection.

DOM 2 HTML

4.6 or later

namedItem()

Retrieves the option node with the given name or id property value from the collection.

DOM 2 HTML

4.6 or later

Last modified: 2014-03-10



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus