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 251843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:37:42+00:00 2026-05-11T21:37:42+00:00

Given the following unordered list, the JQuery selector $(#root #2) selects: /ul/li/ul[@id=’root’]/li/ul[@id=’1′]/li/ul[@id=’2′] Whereas I

  • 0

Given the following unordered list, the JQuery selector $("#root #2") selects:

/ul/li/ul[@id='root']/li/ul[@id='1']/li/ul[@id='2']

Whereas I would have expected it to select the shorter path:

/ul/li/ul[@id='root']/li/ul[@id='2']

Anyone any ideas?

<ul>
    <li>root
        <ul id="root">
            <li>1
                <ul id="1">
                    <li>2
                        <ul id="2"> <!--*selecting this*-->
                            <li>3<ul id="3"></ul></li>          
                            <li>4<ul id="4"></ul></li>
                        </ul>
                    </li>
                    <li>3<ul id="3"></ul></li>
                </ul>   
            <li>2
                <ul id="2"> <!-- *expecting this* -->                   
                    <li>3
                        <ul id="3"> 
                            <li>4<ul id="4"></ul></li>
                        </ul>
                    </li>
                </ul>
            </li>
            <li>3<ul id="3"></ul></li>
            <li>4<ul id="4"></ul></li>
        </ul>
    </li>
</ul>
  • 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-11T21:37:42+00:00Added an answer on May 11, 2026 at 9:37 pm

    Two reasons why the behavior might be undefined / not what you expect:

    1. IDs are expected to be unique, and the path you receive precedes the path you want in the source.
    2. (less likely in this situation) IDs are expected to
      begin with a letter
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following dom structure I would like to transform an ordered list to
Given the following: List<List<Option>> optionLists; what would be a quick way to determine the
Given following Statment: String query = "Select * from T_spareParts where SparePartPK IN (?
Is it possible to have Wordpress generate this type of unordered list? <ul id=nav1>
I have an unordered list in the footer of my html doc. The first
Given following Table select rv, mv, datetime, rawv from mytable where datetime > '2012-01-30';
Given following HTML <select name="IBE1$IBE_NurFlug1$ddl_Abflughafen" id="IBE1_IBE_NurFlug1_ddl_Abflughafen" class="dropdownlist" style="width: 99%;"> <option value="Antalya;TR">Antalya</option> <option value="Berlin;DE">Berlin</option> <option
Given the following string, how would I extract the string between the quotes that
I have the following xml file: <root> <sub type=print>print</sub> <sub type=email>email</sub> </root> I want
Given the following string http://thedude.com/05/simons-cat-and-frog-100x100.jpg I would like to use substr or trim (or

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.