Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Redirect Website for Mobile Devises 9 133
REReplaceNoCase help 1 43
Changing Web Hosts: Need Your Expert Opinion & Ideas 6 40
Adding items to a C# list incrementally 5 30
Read about why website design really matters in today's demanding market.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to dynamically set the form action using jQuery.

856 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