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> |