Javascript Show/Hide function help

They have: 1 posts

Joined: Sep 2009

Hi

I have created a web page with a Show/Hide function on it. The problem is that when I go to the page all the information is showing, but i'd like all the information hidden by default.

You can find my page Here.

Hope someone can help and many thanks for your time

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Recently had this problem as well, had to solve it by adding 'style="display:none"' to each that I wanted to hide by default.

Probably not the best solution but, it was definitely the easiest.

They have: 20 posts

Joined: Oct 2009

Renegade wrote:
Recently had this problem as well, had to solve it by adding 'style="display:none"' to each that I wanted to hide by default.

That's actually a pretty common way to solve this. I consider it a decent solution to the problem. If you're also working with with a server-side programming framework, you can dynamically initialize the display attribute on elements, based on the values of certain variables that might come into play for this decision.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.