On 6/20/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
Jonathan Sharp wrote: > On 6/20/07, *Jörn Zaefferer* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > wrote: > > > Jonathan Sharp wrote: > > I have the following: > > > > $('<div class="foo">').find('.foo').doSomething(); > Why not simply this? > > > Well, the actual implementation is a little more complex. But > basically it can be expanded to: > > $('<div class="foo"></div><div class="bar"></div>').foo().bar(); > > $.fn.foo = function() { > return this.find('.foo').each(function() { > ... > }; > }; > $.fn.bar = ...etc. Okay, in that case you should give filter a try, instead of find. find looks for descendants, while filter works on the "current level".
Doh! Thank you... -js