You are here: irt.org | FAQ | DHTML | Q251 [ previous next ]
You need to access the layers document, i.e. document.layer['layername'].document.images['imagename']
The following illustrates two images, one normal image, and another in a layer:
<img src="imageInDocument.gif" name="myImage" width="100" height="100"> <layer name="myLayer"> <img SRC="imageInLayer.gif" name="myImage" width="100" height="100"> </layer> <script language="JavaScript"><!-- alert(document.layers['myLayer'].document.images['myImage'].src); alert(document.images['myImage'].src); //--></script>