Show/Hide

I want to create a FAQ list of questions.  When you click on the question the answer is displayed.  That simple.  Here is what I have found which works somewhat.  I need for the question to remain displayed all the time, just add the answer.

<script type="text/javascript">
<!--
    function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
//-->
</script>



<div>
<span id="show1" class="show"><a href="#" onclick="showit('readthis1');hideit('show1');"><h3><h2>Will Gc mess up?</h2></h3></a></span><span id="readthis1" class="hide"> No. GC emits no signals, emissions or transmissions.<br /></span>
</div>
akbiroAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Ishaan RawatConnect With a Mentor Designer | Developer | ProgrammerCommented:
0
 
Albert Van HalenConnect With a Mentor Analyst developerCommented:
Have a look here : http://jsfiddle.net/wZ7Fc/
0
 
Ishaan RawatConnect With a Mentor Designer | Developer | ProgrammerCommented:
Or check this..

Its fully made of HTML and CSS only...

http://jsfiddle.net/IshaanRawat/tbhmL/
0
 
akbiroAuthor Commented:
Thank you very much.  I am going to post another question asking someone to look at the code I added to my page and tell me why it is not working.  It works in Dreamweaver, but not on the server.  Thanks!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.