Solved

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

Posted on 2011-09-14
2
392 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
ID: 36540602
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
ID: 36540935
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
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…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

948 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

18 Experts available now in Live!

Get 1:1 Help Now