You can do it using .map() like this:
var myArray = $("#foo span a").map(function() {
return $(this).text();
}).get();
You can test it out here.
You can do it using .map() like this:
var myArray = $("#foo span a").map(function() {
return $(this).text();
}).get();
You can test it out here.