[jQuery] Question about specific $() queries
If I do that I still get ALL of the uls nested under the ul#id
I only want the first level of uls inside of the ul#id, if those ul's
have ul's within them I do NOT want to select those.
[ul id ="myid"]
[li][ul = "myid2"]
[li]One[/li]
[li][ul = "myid3"]
[li]Two[/li]
[/li]
[/ul]
[/li]
[/ul]
For example, using "myid" as the hook I want to select the ul "myid2"
but not select "myid3". Note : the interior UL's dont have actual id
values associated with them.
Abba
Message: 1
Date: Sun, 14 May 2006 12:04:39 -0700
From: "Abba Bryant" <abba.bryant@gmail.com>
Subject: [jQuery] Question about specific $() queries
To: discuss@jquery.com
Message-ID:
<2521d39d0605141204i4e92ef6cw77ee2be030d9685d@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
If I do
$('ul#id ul) I can get all the nested lists in another list. How can I
specify the depth of the returned results? I want to select all the
ul's in another ul by depth. I figured filter or not would work for me
but If I do two queries
q1 = $("ul#id ul");
q2 = $("ul", q1);
I get two results, q1 = the whole set of nested child ul's q2 the
whole set of nested child ul's in q1. Why cant I do this to get just
the difference between q1 and q2
q3 = q1.not(q2); This doesnt seem to work at all. Does it require a
string? If it does and I try to use the not to perform a second query
of any complexity it seems to not do anything, or removes all of my
results.
What I was hoping was for $("ul#id/li/ul").not("ul#id/li/ul/li/ul");
Or even better some of Johns magic on selecting just ul's that are
children of the current lists li's but no deeper.
Abba Bryant
------------------------------
Message: 2
Date: Sun, 14 May 2006 21:16:58 +0200
From: Klaus Hartl <klaus.hartl@stilbuero.de>
Subject: Re: [jQuery] Question about specific $() queries
To: "jQuery Discussion." <discuss@jquery.com>
Message-ID: <4467822A.5000006@stilbuero.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi Abba,
this is possible and pretty easy with CSS selectors:
$("ul#id>li>ul")
HTH,
Klaus
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/