www.webdeveloper.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Location
    UK
    Posts
    378

    DHTML - hide/ show layers, change text

    Hi,

    I know this has been posted a number of times, but my request is slightly different.

    When I click on a link I need it to hide/ show a layer, but now I also need the link text to change, from '+staff' to '-staff'. There are quite a few links that have their own names. Do you know the best way to go about this?

    Thankyou

  2. #2
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,625
    Code:
    <a href="#" onclick="if(this.innerHTML=='+staff'){this.innerHTML='-staff';document.getElementById('oPut').style.display='block'};else{ this.innerHTML='+staff';document.getElementById('oPut').style.display='none'}">+staff</a>
    Where oPut is the ID of the div you are hiding/displaying.
    54 68 65 42 65 61 72 4D 61 79

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



Recent Articles