SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery selector help

    I have the following html, how can i get to the <div class="block"> so that i can put my ajax content inside it.

    js
    Code:
    var index = 1;
    $("h2.trigger").each(function () {
            $(this).next(".toggle_container").find("div:first").html(index);
     index++;
    });
    HTML
    Code:
    <h2 class="trigger"><a href="#">Heading One</a></h2>
    <div class="toggle_container">
     <div class="block">
     
     </div>
    </div>
     
     
    <h2 class="trigger"><a href="#">Heading Two</a></h2>
    <div class="toggle_container">
     <div class="block">
     
     </div>
    </div>
     
    <h2 class="trigger"><a href="#">Heading Three</a></h2>
    <div class="toggle_container">
     <div class="block">
     
     </div>
    </div>
    Thanks
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  2. #2
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is working, i had caching issues.

    Thanks
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...


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
  •