Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | DHTML | Q803 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.