If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

function showHide

Trying to get a picture (of a tutor) to have a paragraph that expands/contracts underneath with an "about that tutor" section when the picture is clicked on (would be nice to also have it expand/contract when the div with the name is clicked)

My problem (besides being brand new to programming ) is that I cannot seem to get the on click function to work. My paragraph loads, but stays hidden. I don't know much on java script and I don't know if I have it in the wrong place, or the code itself is wrong. I assume since the paragraph loads hidden that the css class hiding it works- but just does not switch to the visible class as I would like it to.

Thanks for any help, this is my first webpage and so I'm sorry if I missed any needed information, let me know I'll be watching this post hoping for answer

Instead of the user clicking on the links you can achieve the same effect by clicking on an image.

Note that <script language=javascript> is long deprecated and obsolete. Use <script type = "text/javascript"> instead (in fact also deprecated but still necessary for IE<9). The <!-- and //--> comment (hiding) tags have not been necessary since IE3 (i.e. since September 1997). If you see these in some published script it is a warning that you are looking at ancient and perhaps unreliable code.

Last edited by Philip M; 04-20-2013 at 07:30 PM.

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.