@Steve - I have no control over the html as it comes from a large CMS,
obviously that would have been the initial solution.

I appreciate there are many ways of achieving the same result, the
solution I provided seemed to be the shortest, and I wondered if there
was a more 'moo' way of doing it. From what you are saying it would
seem that this isn't the case.

Cheers

On Aug 27, 4:20 pm, "Steve Onnis" <[email protected]> wrote:
> To answer your question, there are many ways to do it.
>
> I would probably do it like this..
>
> new Element("div", {"id":"wrapper"}).set("html",
> $(document.body).get("html")).inject($(document.body).empty())
>
> You ask if what you showed is the best way?  For me...if it works then great
> :)
>
> -----Original Message-----
> From: atwork8 [mailto:[email protected]]
> Sent: Thursday, 27 August 2009 8:53 PM
> To: MooTools Users
> Subject: [Moo] wrap element's html
>
> Hi,
>
> I've checked the docs but I can't see any method for wrapping the html
> of an element, not the whole element. If I wanted to add a wrapper
> around the body's html is this the best way of doing it:
>
> var elBody = $(document.body);
> elBody.set('html', '<div id="wrapper">' + elBody.get('html') + '</
> div>');
>
>

Reply via email to