<html><head><title> all vs. layers </title></head>
<body>

<div  id="b"  name="b"  style="position:relative;background: #ff0">
This text sits in a layer. The name property of the layer (or "Div") is equal to "b".
</div>

<script language="javascript" type="text/javascript">
 document.writeln("Value of document.all in this browser is: "+document.all+"<br>");
 document.writeln("Value of document.all.b in this browser is: "+document.all.b+"<br>");
 document.writeln("Value of document.layers in this browser is: "+document.layers+"<br>");
</script>

For browsers newer than Netscape 4.xx series, you can use the document.all.MyElementName.style.SomeStyleProperty form to address element styles.  For example, you can use the following button to change the border property of the layer above.

<form><input type="button" value="change border" 
                       onClick="javascript:document.all.b.style.border='solid 1px';">
</form>

</body>
</html>

Notes: The layer tag was used in Netscape 4.xx and earlier, but it has been replaced with the DIV tag (or SPAN).  Whereas earlier browsers used an array called document.layers to refer to these DHTML elements, both IE and Mozilla/Firebird/Netscape now use the document.all array.  So, essentially, all the major browsers now conform to Microsoft's scheme.  The style attributes that are set with cascading style sheets (or just the style="" parameter in a tag) can be accessed using this document.all array as shown above.