Javascript Reference
Categories: HTMLCollection

javascript HTMLCollection Description

@Aug. 17, 2009, 9:44 a.m.
HTMLCollection Firefox/Netscape/NN 6 IE 5(Mac)/6(Win) Chrome/Safari/DOM 1  



The HTMLCollection object is an abstract representation in the W3C DOM of any collection of HTML element objects, all of which exist in the same document tree and have the same tag. For example, in the eyes of the W3C DOM, the document.images array is an HTMLCollection object. All entries are img element object references. JavaScript treats such collections as arrays for access to individual entries via array notation, along with the help of the HTMLCollection's sole property, length. Alternatively, you can use the two methods (item( ) and namedItem( )) to reference a single entry in the collection. All instances of the HTMLCollection object (such as document.images) inherit the property and methods listed below from the abstract HTMLCollection object. See descriptions of each instance(anchors, applets, areas, cells, elements, forms, images, links, options, rows, tBodies, and non-W3C DOM element collections all, children, embeds, and frames).

Object-Specific Properties
Object-Specific Methods
item( ) namedItem( )
Object-Specific Event Handler Properties


Powered by Linode.