Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q803 How do I loop through all the layers in a document in Internet Explorer?

You are here: irt.org | FAQ | DHTML | Q803 [ previous next ]

Microsoft Internet Explorer does not support the Layers as used in Netscape Navigator.

The problem is that there is no such thing as a layer in Internet Explorer. Yoo can loop through the all object, but this doesn't give you the 'layers' - but everthing in the document. In theory everything in Internet Explorer can be treated as a layer.

You might get some mileage out of the all[] objects tags() array.

<SCRIPT LANGUAGE="JavaScript"><!--
if (document.all) {
    for (x in document.all.tags('DIV')) {
        alert(x.id);
    }
}
//--></SCRIPT>

Feedback on 'Q803 How do I loop through all the layers in a document in Internet Explorer?'

©2018 Martin Webb