I have some HTML like:
hello 1 hello 2
you can do it like this
var texts = new Array(); $('#foo > span > a').each(function() { texts.push( $( this ).text() ); });