View Single Post
  #4 (permalink)  
Old 08-16-05, 06:09 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
This works for me:
Code:
<html>

<head>
<script>
function getStyle()
   {
      var temp = document.getElementById("main").style.visibility;
  
      return temp;
   }

 function switchMain()
  {

      var current = getStyle();

      if( current == "visible" )
       {
         document.getElementById("main").style.visibility = "hidden";
       }
       else
       {
         document.getElementById("main").style.visibility = "visible";
       }
  }

</script>
</head>

<body>
<div id="main" style="visibility: visible">Hello</div>

<a href="#" onclick="switchMain()">Change</a>

</body>

</html>
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote