Is there a jQuery way to do an innerWrap? For example:
<div class="outerdiv">
<h3>blah blah blah</h3>
<p>Lorem ipsum dolor sit amet<p>
</div>
I am looking to wrap all of the contents of .outerdiv with another div as
in:
<div class="outerdiv">
<div class="innerdiv">
<h3>blah blah blah</h3>
<p>Lorem ipsum dolor sit amet<p>
</div>
</div>
I tried using .prepend('<div class="innerdiv">') and .append('</div>'), but
the prepend operation closes the div tag. I tried cloning the children of
.outerdiv, emptying .outerdiv, appending the .innerdiv, and appending the
cloned children, which works, but not with multiple classes. Any
suggestions?
--
View this message in context:
http://www.nabble.com/Is-there-a-jQuery-way-to-do-an-innerWrap--tf3304247.html#a9191323
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/