Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3616684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:31:45+00:00 2026-05-18T22:31:45+00:00

My divs are nested like this. <div id=top> <div class=child1> <div class=child-child> <div class=child-child-child>

  • 0

My divs are nested like this.

<div id="top">
   <div class="child1">
      <div class="child-child">
         <div class="child-child-child">
         </div>
      </div>
   </div>   
   <div class="child2">
      <div class="child-child">
         <div class="child-child-child">
         </div>
      </div>
   </div>   
</div>

Right now I’m going from #top to .child-child-child by doing this.

$('#top').children('.child1')
         .children('.child-child')
         .children('.child-child-child');

Do I have to specify the full path like this? I want to omit the middle divs if there’s a syntax that would let me do that. But I probably still need to specify whether I want to go through .child1 or .child2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:31:45+00:00Added an answer on May 18, 2026 at 10:31 pm

    You do need to specify which path to take, but you could make it a little shorter:

    $('#top > .child1').find('.child-child-child');
    

    This will give you the '.child-child-child' that is a descendant of .child1.

    Or you could write it like this, using only selectors:

    $('#top > .child1 .child-child-child');
    

    Or this, using only traversal methods:

    $('#top').children('child1').find('.child-child-child');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have nested divs like so: <div class=first> <div class=second> <div class=third></div> </div> </div>​
I'm doing a little experiment, trying to alternate background colours for nested divs. This
I have markup similar to this: <div class='wrapper plugin'> //some content <div class='child-wrapper plugin'>
So let's say I have a block of nested divs: <div class='nested'> <div class='nested'>
I have a nested div like this <div id=one> <div id=two> id two goes
I have nested divs like this (pseudo code..) <div0> <div1></div1> <div2>fluid width</div2> <div3></div3> </div0>
I have HTML that looks something like this: <div class='textbox' data-title='Sometitle'> <div class='textareaedit'> <p><strong>Test
I have those 2 divs nested into the yellow div, and as you can
I am looking to make a clickable div that has further divs nested inside.
I have a list which have divs inside it.. Now when i use nested

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.