length Property

Internet Development Index

Sets or retrieves the number of objects in a collection.

What's New for Microsoft® Internet Explorer 6

This property now applies to the comment object.

Syntax

HTMLN/A
Scriptingobject.length [ = iLength ]

Possible Values

iLengthInteger that specifies or receives the number of objects.

The property is read/write for all objects except the following, for which it is read-only: COMMENT, pages. The property has no default value.

Remarks

The window.length property returns the number of frames contained in a window.

The comment.length property returns the number of characters in the object.

Although this property is read-only for most of the objects listed in the Applies To section objects, it is read/write for the areas collection (image maps), the options collection (select boxes), and the select object.

In all other cases, this property has read-only permission, which means you can retrieve, but cannot change, its current value.

The form.length property does not count input type=image elements. To access all elements contained in a form, use the children collection.

For Microsoft Windows® CE only, this collection will always be empty.

Standards Information

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

all, anchors, applets, areas, attributes, behaviorUrns, bookmarks, boundElements, cells, childNodes, children, COMMENT, controlRange, elements, embeds, filters, forms, frames, images, imports, links, namespaces, options, pages, plugins, rows, rules, scripts, SELECT, styleSheets, tBodies, TextRectangle, TextRange, window, FORM