Need some (probably basic) Javascript help

Joined: 11/28/2008

Javascript is definitely not my strong point! Hoping someone can help.

Here's what I want to do...I want to have an intro paragraph of text with a SHOW MORE button or text link. When that is clicked is shows the rest of the text but SHOW button goes away and in its place is a COLLAPSE or SHOW LESS button or link.

I have most of it working but not sure how to swap out the SHOW and HIDE links.

Can someone help?

Thanks!
Chris

Joined: 10/18/2008
If you're using jquery, all

If you're using jquery, all you'd need to do is:

$(document).ready(function(){
$(#showmorelink).click(function(){
  $(#myshowbutton).hide();
  $(#mycollapsebutton).show();
});
});

If you're doing any javascript work, jquery is the way to go since it's supported in all browsers whereas javascript itself may or may not be supported depending on how you write it.

/ * Begin Signature */
It's a strange thing about determined seekers-after-wisdom that, no matter where they happen to be, they'll always seek that wisdom which is a long way off. Wisdom is one of the few things that looks bigger the further away it is.