| Availability: |
| |||||||
| JavaScript syntax: | IE | myCollection = myDocument.all | ||||||
| IE | myCollection = myDocument.children | |||||||
| IE | myCollection = myDocument.filters | |||||||
| - | myCollection = myDocument.getElementsByName(aName)[anIndex] | |||||||
| IE | myCollection = myElement.all | |||||||
| IE | myCollection = myElement.children | |||||||
| IE | myCollection = myElement.filters | |||||||
| - | myCollection = myDocument.getElementsByTagName(aTag)[anIndex] | |||||||
| Argument list: | aName | The name attribute of an element | ||||||
| anIndex | A valid reference to an item in the collection | |||||||
| aTag | The name of a tag | |||||||
| Object properties: | length | |||||||
| Object methods: | Item(), namedItem(), tags() | |||||||
A collection object is an enhancement to the basic array object to provide some additional searching capabilities for managing the contents of the document object model in a web browser.
Do not confuse DOM NodeList arrays with Enumerator or Collection objects. The NodeListitem() method is subtly different from the Enumerator.Item() method.
| See also: | TABLE.cells[] |
| Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| length | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ReadOnly |
| Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Item() | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 5.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | ![]() |
| namedItem() | 1.5 ![]() | 5.0 ![]() | 6.0 ![]() | 5.0 ![]() | 5.0 ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
| tags() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| Prev | Home | Next |
| Collation sequence | Up | Collection.Item() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||