i think you will need to feed a variable, because jquery loops through each node, so:
var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw <[EMAIL PROTECTED]> wrote: > > ah why not try $("body").text() That should strip all of the markup? > > - jake > > > > On Fri, May 2, 2008 at 8:55 AM, Joe <[EMAIL PROTECTED]> wrote: > > > > Okay I have read and reread > http://www.learningjquery.com/2006/11/how-to-get-anything-you-want-part-1 > > > > and > > > > http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2 > > > > and still cannot figure out how to grab all the text (not the markup) > > on a page. I am toying with the Google Translation API and am > > attempting to parse all text, translate, and put it back. I have the > > looping logic (and the 500 char limit issue with Google) sorted out, > > but I can't get the fundamental part down...GRABBING ALL THE TEXT. > > > > So let's say you have markup like so > > > > <ul> > > <li><a href=somelink>blabh blah 1</a></li> > > <li><a href=somelink>blabh blah 2</a></li> > > <li><a href=somelink>blabh blah 3</a></li> > > </ul> > > > > and even > > > > <h1>some heading</h1> > > > > and > > > > <p>Some paragraph text</p> > > > > etc. etc. > > > > I want to be able to grab all the text and manipulate it. > > > > I've tried $("#mainContainerDiv *").each(...some function....), but > > this crashed the system. > > > > I would like to do something like this: > > > > $("#mainContainerDiv *.text".each(....some function...), but this > > clearly won't work. > > > > Any help is greatly appreciated. > > > > > -- Alexandre Plennevaux LAb[au] http://www.lab-au.com