Jörn, filter() appears to behave the same way that find() does, looping through and stacking the results in order, not by appearance in the DOM.
Pax, - Stan On Nov 23, 3:05 am, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > Karl Swedberg schrieb: > > > Hi Stan, > > > this topic has come up once before at least, and I can definitely > > understand the confusion. The conciseness of the syntax in this case > > perhaps leads to unexpected results. I'm not sure what the rationale > > is, but using a filter function should give you the results in the > > order you want them. Something like this maybe? > > > $('div').filter(function() { > > return this.className.match(/classOne|classTwo/); > > }) > > > That should give you the divs in the order they appear in the DOM. > > How about this: $("div").filter(".one, .two")? > > Jörn