I'm trying to wrap all the child elements of a div
, inside an inner-wrapper div
.
From this :
<div class="parent">
<div class="first-child>
<div class="second-child>
<div class="third-child>
</div>
To this :
<div class="parent">
<div class="inner-wrapper>
<div class="first-child>
<div class="second-child>
<div class="third-child>
</div>
</div>
I've tried to use replaceChild but I'm not sure how it works.
Trying to do this in native js only :)