Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js copy a div

// Get the element
var elem = document.querySelector('#elem1');

// Create a copy of it
// The 'true' is to allow nested elements to be copied as well
var clone = elem.cloneNode(true);
Source by gomakethings.com #
 
PREVIOUS NEXT
Tagged: #js #copy #div
ADD COMMENT
Topic
Name
8+8 =