Quick Search:
 
 JavaScript: Show/Hide Toggle Jump to:  
Category: >> JavaScript >> Show/Hide Toggle  

<< lastnext >>

Snippet Name: Show/Hide Toggle

Description: Shows or hides content with the click of a link.

Comment: (none)

Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: February 28th, 2009

<s c r ipt language="javascript">
FUNCTION toggleDiv(id)
{
   VAR div = document.getElementById(id);
   VAR current = div.style.display;
 
   IF (current == 'none')
      div.style.display = 'block';
   ELSE
      div.style.display = 'none';
 
}
</ s c ript>
 
<a href="javascript:toggleDiv('block');">Toggle Block</a>
 
<div id="block">This IS my Block</div>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org