I want to wrap all Body content into a <div>, not including the <body> tag, details,
change files DOM from
<html>
<body>i'm a body</body>
<p>i'm out of body</p>
</html>
to (just put all inside of body into one div)
<html>
<body>
<div id='bodyContainer'>
i'm a body
</div>
<div id='footer'>
i'm a footer
</div>
</body>
<p>i'm out of body</p>
</html>
I tried to make it happen by jQuery
$(document).ready(function() {
$("body").append("<div id='container'>I'm a body-container</div>");
$("body").append("<div id='footer'>i'm testing!</div>");
});
but failed to reform DOM as
<html>
<div id='bodyContainer'>
<body>
i'm a body
</body>
<p>i'm out of body</p>
</div>
<div id='footer'>
i'm a footer
</div>
</html>
this is not what I want, please see example http://jsfiddle.net/7szM4/2/ Thanks.