How do I insert a HTML element twice using JavaScript?
This code isn\'t working:
var div = document.createElement(\'div\'); div.innerText = \'Hello!\
Ok I found that you just have to use cloneNode:
var div = document.createElement('div'); div.innerText = 'Hello!'; document.body.appendChild(div); var div2 = div.cloneNode(true); document.body.appendChild(div2);