Solved

Show/Hide

Posted on 2013-05-17
4
269 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 10

Accepted Solution

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access RV042 GUI / Browser Issues 25 49
suddenly angular cli doesn't work. 5 42
Javascript 2 28
Get checkbox id of the previous one selected 2 17
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

830 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