0

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 :)

Marine Le Borgne
  • 1,036
  • 2
  • 11
  • 39
  • There are many question on StackOverflow targeting this topic. Please take the time and look trough those questions and answer. If those do not fully answer your question, then refere to them and explain why they do not answer your question. – t.niese Jun 09 '18 at 14:36
  • I couldn't find any actually, probably a wrong use of keywords, thanks for the links :) – Marine Le Borgne Jun 09 '18 at 14:36
  • [Wrapping a set of DOM elements using JavaScript](https://stackoverflow.com/questions/3337587) – t.niese Jun 09 '18 at 14:37

0 Answers0