I'm trying to insert an opening <div class="container"> after <body> and a closing </div> before </body>
I'd like for there to be a function like wrapAll() that would apply internally, on the html() of an element. Something like wrapAllInner() would be great.
I've tried:
1) $('body').html().wrapAll('<div class="container"></div>');
which didn't work at all. $("body").html().wrapAll is not a function. weird.
2) $('body').children().wrapAll('<div class="container"></div>');
which for some reason caused the js to get repeated twice. It even caused an alert() I placed right after it to get repeated twice. whut?
Thanks so much,
long time listener, first time caller