How can I using javascript make clone of some <div> and set his id different from original. Jquery also will be nice.
<div>
var div = document.getElementById('div_id'), clone = div.cloneNode(true); // true means clone all childNodes and all event handlers clone.id = "some_id"; document.body.appendChild(clone);
1.4m articles
1.4m replys
5 comments
57.0k users