View Full Version : Using text links to make additional text appear

Sign of Eth
08-21-2005, 03:19 PM
As a JS neophyte I'm having a problem creating for myself a script that does something I've seen on countless sites. And since my knowledge of JS syntax is poor, all my combinations of keywords in Google searches have proven fruitless.

This is what I have:

Text Link 1
Text Link 2
Text Link 3

The functionality I seek is this: When someone clicks on one of the links, say #1, the appearance becomes:

Text Link 1
Here is where some text has magically appeared!
Isn't it nice? Click to make disappear.
Text Link 2
Text Link 3

And, naturally, when the "Click to make disappear" text is clicked the appearance returns to its default state.

Can anyone help me work something out?

Thanks. :)

08-21-2005, 04:05 PM
That is extremely close to Dynamic Drive's Switch Content Script (http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm). It could easily be adapted to be exactly like you say.

Sign of Eth
08-21-2005, 05:28 PM
Thanks so much. This is perfect. :D

05-14-2009, 06:42 PM
is there a way to do this without Java and just use HTML completely?