I have some HTML like:
hello 1 hello 2
Try this:
var texts = new Array(); //or... var texts = []; $('#foo a').each(function() { texts.push($(this).text()); })