is it possible by using JavaScript to open any tag, for example div#js and insert closing tag in any place I want, like on example below?

```
<div id="first"></div>
<div id="js">
<div id="second"></div>
<div id="third"></div>
</div>
<div id="fourth"></div>

```