Solved

Show/Hide

Posted on 2013-05-17
4
266 Views
Last Modified: 2013-05-31
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>
0
Comment
Question by:akbiro
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:Albert Van Halen
Albert Van Halen earned 167 total points
ID: 39174399
Have a look here : http://jsfiddle.net/wZ7Fc/
0
 
LVL 9

Accepted Solution

by:
Ishaan Rawat earned 333 total points
ID: 39174602
0
 
LVL 9

Assisted Solution

by:Ishaan Rawat
Ishaan Rawat earned 333 total points
ID: 39174633
Or check this..

Its fully made of HTML and CSS only...

http://jsfiddle.net/IshaanRawat/tbhmL/
0
 

Author Closing Comment

by:akbiro
ID: 39210334
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now