Created
June 23, 2012 14:32
Accordion_ToggleVisibility_Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
/* | |
** Name: toggle_visibility | |
** Desc: toggles id of element to be visible or not | |
*/ | |
function toggle_visibility(id) { | |
var e = document.getElementById(id); | |
if (e.style.display == 'none') | |
e.style.display = 'block'; | |
else | |
e.style.display = 'none'; | |
} | |
</script> | |
<p><a title="Click to show/hide FAQ" href="javascript: toggle_visibility('FAQ1');">Question</a></p> | |
<div style="display: none;" id="FAQ1"> | |
<p>Answer</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment