Javascript Show/Hide function help
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 posted this at 02:12 — 20th September 2009.
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.
Daryll1 posted this at 16:16 — 31st October 2009.
They have: 20 posts
Joined: Oct 2009
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.