[jQuery] Re: Quick question about the ".each()" function

2007-04-06 Thread Kenneth
Your initial code block: $('.wordbreakfield').each(function(){ $(this).text(); }); ...doesn't do anything with the text(). You retrieve it but it's not used. On 4/6/07, Yansky <[EMAIL PROTECTED]> wrote: Hi, thanks for the reply. I'm still a bit confused though. :) If "$('.wordbreakfield

[jQuery] Re: Quick question about the ".each()" function

2007-04-06 Thread Yansky
Hi, thanks for the reply. I'm still a bit confused though. :) If "$('.wordbreakfield')" returns an array of jquery objects, then ".each(function(){" applies a function to the raw DOM of each element, & using "$(this)" accesses the jquery object rather than the raw DOM so we can use the "text()" f

[jQuery] Re: Quick question about the ".each()" function

2007-04-06 Thread remy
Because: On Apr 6, 7:58 am, "Yansky" <[EMAIL PROTECTED]> wrote: > $.map(theData, function(i){ > return i.childNodes[0].nodeValue; > > }); The .map function is returning an array of the result of each function call - in your case: > return i.childNodes[0].nodeValue; You second block doesn't