HTMLCollection

Availability

BlackBerry Device Software version 4.6 or later

The HTMLCollection object is an array that contains an ordered collection of nodes. HTMLCollection objects are automatically updated when the underlying document is changed.

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

myHTMLNodes.item(2)

myHTMLNodes.namedItem(“item”)

is equivalent to specifying

myHTMLNodes[2]

myHTMLNodes[“item”]

Properties

Property name

Type

Description

Status

Support level

Availability

length

int

Returns the number of nodes in the list.

read only

DOM 2 HTML

4.6 or later

Methods

Method name

Description

Support level

Availability

item()

Returns the node at the specified index.

DOM 2 HTML

4.6 or later

namedItem()

Retrieves the node with the given name 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