An observation I just noticed...

To do the following...
$(start).find('div.classOne, div.classTwo');
And have it order properly, with Karl's example it'd actually need to
be:
$(start).find('*').filter(function() {
        return this.className.match(/classOne|classTwo/);
}) ;

I just noticed this while trying it out.

Pax,
- Stan


On Nov 23, 7:51 am, Wizzud <[EMAIL PROTECTED]> wrote:
> On Nov 23, 8:05 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>
>
>
> > How about this: $("div").filter(".one, .two")?
>
> > Jörn
>
> Nope, sorry.
> That will (A) filter for '.one', then (B) filter for '.two', returning
> the results of A appended by the results of B.
> So...
> <div id='A' class='two'></div>
> <div id='B' class='one two'></div>
> <div id='C' class='two'></div>
> <div id='D' class='one'></div>
> ...gets 5 results returned in BDABC order (which, btw, I think is a
> bug because the second B should not be there! - filter() should *not*
> be _expanding_ the original element set, even though it's by
> duplication; the returned set should be a subset of the originals and,
> ideally, unique.)
>
> The only way to do it (in current jQuery core) is, as Karl proposed,
> by using a function.

Reply via email to