3 ms·
In your last example, `.find('.more_stuff')` works on the value returned from `.addClass('other')` (or so it'd seem), so it behaves differently.
by tordek 15y ago
In your last example, `.find('.more_stuff')` works on the value returned from `.addClass('other')` (or so it'd seem), so it behaves differently.
- Groxx 15y agoWhich, with jQuery, is the same as the results from the most-recent selector in the chain (in this case, the .find('.stuff') before it). Normally though, you'd be absolutely correct, and that example would need to nest the .addClass('other') inside its .find so it doesn't pollute the next .find: $('.class') .find('.sub').remove() .find('.stuff') .addClass('other') .find('.more_stuff').removeClass('things') .filter('li').appendTo('#my_list')