Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    hidden div doesn't show: Why?



    What did I do wrong? I would like to have an anchor link with hidden text. When I click on the anchor link, I want to see a text drop below showing the Keep trying information. It keeps giving me "object expected" error message.

    What object I need to put in there. Thanks.

    Here is the code:

    Code:
     
    <body>
    <a href="#" onclick="showDiv('divFundamentals');return false;">Javascript Fundamentals</a>
    <div id="divFundamentals" style="display:none;">
    
    Basic - Javascript
    Keep trying:
    
    Keep trying 
    - Try hard 1
    - Try hard 2
    - Try hard 3
    - Try hard 4
    - Try hard 5
    
    </div>
    
    
    <script>
    function showDiv(id) 
    {
    $('#' + id).show();
    }
    </script>
    
    </body>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Do have jquery or any other type of prototype library with your files?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    NLuu (12-10-2009)

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Aerospace, thanks for quick reply. We've got it work now.


  •  

    Posting Permissions

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