Solved

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

Posted on 2011-09-14
2
395 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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…

773 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