# HTMLCollection : Object
Return to: HTML DOM Level 2 index

Collection of HTML elements.

## Platform Support

IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | ---
no | 1.0+ | 6.0+ | 7.0+ | no

## Constructors

Constructor | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
HTMLCollection Constructor() : HTMLCollection Collection of HTML elements. | Show Details | no | 1.0+ | 6.0+ | 7.0+ | no

### HTMLCollection() : HTMLCollection

Collection of HTML elements.

Returns

HTMLCollection |

Visibility
  internal

## Properties

Property | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
length : Number Number of elements in the collection. | Show Details | no | 1.0+ | 6.0+ | 7.0+ | no

Availability

  HTML DOM Level 2|W3C

## Functions

Method | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
static item(Number index) : Node Returns the element found at the specified position in the collection. | Show Details | no | 1.0+ | 6.0+ | 7.0+ | no

Parameters

Number | index | Index position of the element.

Returns

Node |

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/dom/tests/item.html

See Also

  NodeList.item

Availability

  HTML DOM Level 2|W3C

static namedItem(String name) : Node Returns the element with the specified Id. | Show Details

Parameters

String | name | Name of the element.

Returns

Node |

Availability

  HTML DOM Level 2|W3C

## Remarks

Use the `item` method to return an element by index position. Use the `namedItem` method to return an element by its name.

## References

NodeList

## Availability

HTML DOM Level 2|W3C

text_javascript aptana_docs