If I have
$('.rotator li').each(function() {
$(this).further-nested-elements.somefunction();
});
how can I reference elements that are nested below this so I don’t have to keep re-typing the original selector (i.e. $('.rotator li')) every time I want to access it?
Use
.find():Or, use
thisas the context:I prefer the second method because, in my head at least, it seems like it has to do less work – only one function call, creating only one jQuery object instead of two.