Document.layers[] (Collection)

An array containing a list of layers in the document.

Availability:

JavaScript - 1.2
Netscape - 4.0
Property/method value type:LayerArray object
JavaScript syntax:NmyDocument.layers
HTML syntax:<LAYER>

Each item in this array corresponds to a <LAYER> tag in the document. This array also includes layers that are created in Netscape by setting the position attribute of an HTML <DIV> block to absolute.

The layers in this array are ordered according to the order in which they appear in the document. Layers can be accessed associatively if they have been given an ID with the ID="..." or NAME="..." tag attribute. This means you can refer to an element whose ID is set to ABC by its unique name. Either as document.ABC or document layers["ABC"].

Warnings:

See also:Document object, ID="...", Layer.layers[], LayerArray object, style.position

Property attributes:

ReadOnly, DontEnum.