Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: DIV Show/Hide

  1. #11
    Join Date
    Jan 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    Code:
    <script type="text/javascript">
     function showHide(obj) {
       var div = document.getElementById(obj);
       if (div.style.display == 'none') {
         div.style.display = '';
       }
       else {
         div.style.display = 'none';
       }
     }
    </script>
    Then call it like so:

    Code:
    <a href="#" onclick="showHide('hidden_div'); return false;">Some Text</a>
    
    <div id="hidden_div" style="display: none;">
      Hidden Text is here!!!!!
    </div>
    Hope this is what you mean. If not, please be more specific in your request.

    this one is the best one and works on IE, please can you tell me how to make it work in firefox? because it does not work in firefox..

    thanks..

  2. #12
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    It should work in Firefox as that is the browser I tested this out in. If it is not working for you, please post a link to your problem page so that we can see what it is doing.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •