I’m new to jquery and find solution about this,
<div id="parent">
<div class="child1">Child 1 Contents</div>
<div class="child2">Child 2 Contents</div>
</div>
I want to make new parent div element after <div id="parent"> and include all child from this parent to new parent using jquery, so the result html looks like below:
<div id="parent">
<div id="newparent">
<div class="child1">Child 1 Contents</div>
<div class="child2">Child 2 Contents</div>
</div>
</div>
How to solve this using jquery?
jQuery’s wrapInner should do the trick: