It would be better if i could somehow use something like a textNode or something as i need to locate the text string and find out what its parent element is
-----Original Message----- From: Fli7e [mailto:[email protected]] Sent: Monday, 28 March 2011 11:02 PM To: MooTools Users Subject: [Moo] Re: replaceing a text string maybe this is what you are looking for ... document.body.getElements('div').each( function(elm){ elm.set( 'html', elm.get('html').replace(/(searchterm)/g,"<span>$1</span>") ); }); On 28 Mrz., 13:34, "Steve Onnis" <[email protected]> wrote: > can anyone suggest an easy way to replace some text on a page, well actually > i want to wrap text strings on a page with a span tag > > so for example > > <div>this is some text</div> > > Would become > > <div>this is <span>some</span> text</div>
