This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

length

Property of dom/HTMLElementdom/HTMLElement

Syntax

var result = element.length;
element.length = value;

Notes

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 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 length property does not count input type=image elements. To access all elements contained in a form use the children property of the HTMLElement. This property is read-write on the areas collection for image maps and the options collection for select boxes. This allows a developer to shrink the collection. For Windows CE only, this collection will always be empty. As of Windows Internet Explorer 8, this property is read-only in the areas collection. In Microsoft Internet Explorer 6 and later, this property applies to the comment object.

Syntax

Standards information

Attributions