[jQuery] Quick question about the ".each()" function
Hi, I'm trying to get the text from an array of <td> elements and
return it as an array. I've used the following code, which seems to
work fine:
var theData = $('.wordbreakfield');
$.map(theData, function(i){
return i.childNodes[0].nodeValue;
});
My question is, why can't I just do the following?
$('.wordbreakfield').each(function(){
$(this).text();
});
Why doesn't that also return the text for each element in the array?