Solved

How to display/hide text on a web page using openClose in HTML

Posted on 2011-09-14
2
389 Views
Last Modified: 2012-05-12
I am trying to create a FAQ page where the answers to the FAQ will appear if you click on the question. The FAQ are in a numbered list. I figured out that openClose must be used, so I have something like this:

<div onClick="openClose('Answer1')" ><<li><span class="style_bold" >Question 1 here.</span></li>
<div id="Answer1" class="style_bold" ><p>Answer 1. </p></div>
<hr />

Clicking on a question should make the answer to the question visible. Clicking on another question should close the first answer and open the appropriate answer.

Thanks
0
Comment
Question by:stevepcguy
2 Comments
 
LVL 5

Accepted Solution

by:
KGNickl earned 500 total points
Comment Utility
You will need to use both CSS and Javascript. The link below has both code and working examples:

http://www.cssnewbie.com/showhide-content-css-javascript/
0
 
LVL 8

Author Closing Comment

by:stevepcguy
Comment Utility
Thanks very much! Perfect for me. I was able to learn from this page.

Sometimes a link to an excellent page is all it takes.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 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

6 Experts available now in Live!

Get 1:1 Help Now