Connecting Tech Pros Worldwide Forums | Help | Site Map

How to I reveal a section of my page on the click of a button?

Newbie
 
Join Date: Nov 2008
Posts: 1
#1: Nov 10 '08
I want to have a button that when clicked, reveals a section of my page including several images, text, tables, and some drop down menus. I want the page to start with that section hidden at first but other sections visible. Is there a code to do this? Ideally I would like to just drop the code into something simple like this:

When user clicks this button reveal the following [

here is where the code for all my images, text, tables, and drop down menus goes.

]

Please help. Thanks.

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Nov 10 '08

re: How to I reveal a section of my page on the click of a button?


Yes, this is possible, but not with HTML/CSS. You need JavaScript. I can move this thread to the JavaScript forum for you.

Look into the style.display property. Set to "none", the content will be hidden. If you set it to "block" in your function called onclick, the content will show up. An alternative is the style.visibility property.
Reply