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>');