i want to insert a htmlsnippet into another html-element
i tried it this way
the html
insert this html elemen
innerHTML
doesn't insert DOM nodes, just strings.
Use appendChild
instead
var box1 = document.querySelector(".box1");
var box2 = document.querySelector(".box2");
box2.appendChild( box1 );
You should use the appendChild method.
box2.appendChild(box1);
This should work:
box2.appendChild(box1);