[jQuery] Re: Find set of questions
Ah ok I follow you now. Ok I'm not certain this will work; I haven't tested it but give it a go and see what you get. From the jQuery selectors documentation: Hide all Paragraph elements that contain a link: $("p[a]").hide(); So my guess at how to do what you want would be: $("ol.ol1[li.correctchosen]"); If my understanding is correct, that will give you all s with class 'ol1' which contain an of class 'correctchosen'. Give it a shot and let us know the result! --rob On 6/5/07, SamCKayak <[EMAIL PROTECTED]> wrote: I am learning, I am learning... I missed the subtle difference in the documentation: $('a, b') and $('a', 'b') !!! The way to filter my list is using a function.. like so: ('ol.ol1 > li').filter( function() { return $('li.correctchosen ', this).length != 0 } ) // Filters the first set down to those that contain a "correct chosen list element somewhere deep inside the dom subtree of 'this' element. Any short technique appreciated. Overview of the HTML: ... html here... -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Find set of questions
I am learning, I am learning... I missed the subtle difference in the documentation: $('a, b') and $('a', 'b') !!! The way to filter my list is using a function.. like so: ('ol.ol1 > li').filter( function() { return $('li.correctchosen', this).length != 0 } ) // Filters the first set down to those that contain a "correct chosen list element somewhere deep inside the dom subtree of 'this' element. Any short technique appreciated. Overview of the HTML: ... html here...
[jQuery] Re: Find set of questions
Not certain I understand your requirements exactly, but try one of the following: $('ol.ol1 > li.correctchosen'); or $('ol.ol1 > li').find('.correctchosen'); Does that help? --rob On 6/4/07, SamCKayak <[EMAIL PROTECTED]> wrote: $('ol.ol1 > li') // returns a complete set of list elements containing quiz results... Some of the results contain correct answers, some incorrect answers... The indicator would be another list contaiing the choices and assigned classes: .correctchosen or .correctnotchosen How do I filter the set so that it returns the set of correct list elements? I want $('ol.ol1 > li'), but only those that contain at a deepter level of the DOM, another li.correctchosen Something like: $('ol.ol1 > li').filter('go inside the li, looking for li.correctchosen') Sam -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.