Lets say that I have a HTML that looks like this:
1
2
$(obj).find('span')
should do the trick.
easiest way is this, if you want all the elements
$('.aaa span');
jquery can nest selectors just like css can. also, if for some reason you need to loop
$('.aaa').each(function(){
x = $(this).find('span');
});
that will set x as the elements as a jquery object.
$('.aaa').each(function(index, obj){
var x = $(this).find('span');
$(x).doSomething();
})
or more prgramatically:
$('.aaa').each(function(index, obj){
$(this).find('span').doSomething();
})
$('.aaa').each(function() {
var x = $('span', this);
});
If that's your actual markup, you can easily use the native property firstChild.
$('.aaa').each(function(){
var x = this.firstChild
});
It is a widely supported property.