JSFiddle - React, Tailwind, and code Playground
by cou929
HTML
<div class="section">
<button id="button">Append Nodes of Array</button>
<div id="target"></div>
</div>
JavaScript
$('#button').on('click', function () {
var fragment = document.createElement('div');
fragment.innerHTML = '<p>1</p><p>2</p><p>3</p>';
var nodes = fragment.children;
var target = document.getElementById('target');
var i;
for (i = 0; i < nodes.length; i++) {
// clone each node
target.appendChild(nodes[i].cloneNode(true));
}
});