[Javascript] Layer can't be accessed in IE

Reuben D Budiardja reubendb at goshen.edu
Wed May 16 23:57:34 CDT 2001


Hi all,
I have a page with layer, and a link to switch between one layer to the 
other. The link will run the javascript function that will change the layer 
to hide and visible. This works well with Netscape 4.7, but does not work 
in IE. How does one access the layer object in IE? any help will be greatly 
appreciated. The following is the simplified code.

Thanks.
Reuben D. Budiardja
-------------------------------

<SCRIPT>
function toSimpleSearch()
   {
   document.layers["advance_search"].visibility = 'hidden';
   document.layers["simple_search"].visibility = 'visible';
   }
function toAdvanceSearch()
   {
   document.layers["advance_search"].visibility = 'visible';
   document.layers["simple_search"].visibility = 'hidden';
   }
</SCRIPT>


<DIV id="simple_search" style="position:absolute; width:480px; 
height:1000px; z-index:1; left: 10px; top: 10px; visibility: visible">
<A HREF="javascript:toAdvanceSearch()">Advance Search</A>
<!-- HTML TABLE and FORM -->
</DIV>

<DIV id="advance_search" style="position:absolute; width:480px; 
height:1000px; z-index:1; left: 10px; top: 10px; visibility: hidden">
<A HREF="javascript:toSimpleSearch()">Simple Search</A>
<!-- HTML TABLE and FORM -->
</DIV>





More information about the Javascript mailing list