Click to See Complete Forum and Search --> : Changing style (visibility) with Javascript


frasernm
01-09-2003, 01:58 AM
Hi,

I'm trying to write a script that allows the viewer to click or hover over a link (a question) that will change the visibility of the following paragraph (the answer) from hidden to visible.

I may have more than one question on each page so I was hoping to pass the ID of the answer to the function (if this would work), so I could view only one answer at a time.

My existing HTML is along the lines of:

<p><a HREF="#" CLASS="nowrap">here is a question<img alt="question" src="graphics/why.jpg" CLASS="questionimage"</a></p>
<p ID="answer1" CLASS="invisible"><b>Answer:</b> the answer is here!</p>

I'm not sure whether it's easier to use CLASS="visible" and CLASS="invisible" rather than specifying the style.

Thanks in advance,

Fraser

frasernm
01-09-2003, 03:10 AM
Much appreciated,

Fraser