node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org ยป

clonenode

npm install clodeNode

module.exports = deepClone

function deepClone(el){

	var node = el.cloneNode();

	Array.prototype.slice.call(el.childNodes).forEach(function(child){
	  node.appendChild(deepClone(child))	
	});

	return node

}