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

  • Home
  • SEARCH
  • 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 915357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:52:27+00:00 2026-05-15T17:52:27+00:00

How do I write jQuery selector to test if li has ul that has

  • 0

How do I write jQuery selector to test if li has ul that has at least one li that is not .disabled (may be other classes or without class at all).

Yes sounds complex but it’s simple – I need to know if there’re uls that do not have “disabled” class on inner lis.

Something like

$("li").filter("*:has(ul:has(li:not(.disabled)))")
  • 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-15T17:52:28+00:00Added an answer on May 15, 2026 at 5:52 pm

    You can shorten it a bit, like this:

    $("li").filter(":has(ul li:not(.disabled))")
    

    You can try it here. Since the <li> is a child of <ul> you can just refer to it that way, no need for the extra :has() selector confusing Sizzle (multiple :not() in a chain do this as well).

    Unless there’s the possibility of a <ol> you could remote the ul part as well, just having:

    $("li").filter(":has(li:not(.disabled))")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Jquery event chaining Traditionally we may write: $(selector).click(function () { }); but
Write a class ListNode which has the following properties: int value; ListNode *next; Provide
I wrote selector like this jQuery(td:contains('test')).parent(tr).find(a) I want to click link in table. It
I'm trying to write a jQuery script (I have never written one before and
Is there a better more performance way to write this jQuery selector using either
in jQuery you can write something like $(selector).bind('click', function(e) { // something was true
I need to loop through my website using jquery and change the class selector
Jeff mentioned the concept of 'Progressive Enhancement' when talking about using JQuery to write
Please write a list of tasks that a copy constructor and assignment operator need
I write a singleton c++ in the follow way: class A { private: static

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.