New javascript document

A small javascript code fragment for creating a new document containing part of an existing document
var newDoc = document.implementation.createDocument(“”, “”, null);
var sd = newDoc.importNode(content, true);
newDoc.appendChild(sd);

Leave a Reply

Your email address will not be published. Required fields are marked *