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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    265
    Thanks
    49
    Thanked 1 Time in 1 Post

    jquery toggle not working

    Hi Folks,

    On this page, I have "Read more..." in the first lorem ipsem paragraph. This is inside a
    Code:
    <span id="s-hpi">
    .

    I have:
    Code:
    <script type="text/javascript">
    $(document).ready(function(){
      $("#s-hpi").click(function(){
        $("#hpi").toggle();
      });
    </script>
    in the head region.

    However, clicking on #s-hpi does not toggle #hpi. How can I fix this? Thanks.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    It’s impossible to tell you if you don’t show us all your code. The snippets you posted don’t tell us anything about the context in which you use them, and most likely it’s the context where something goes wrong.


  •  

    Posting Permissions

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