HTML DOM createHTMLDocument() Method Last Updated : 12 Jul, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOMImplementation createHTMLDocument() method is used to create a new HTML Document. Syntax: newDoc = document.implementation.createHTMLDocument(title); Parameters: title (Optional): It is a DOMString containing the title to be used for the new HTML document. Return Value: This function returns Created HTML Document. Example: In this example, we will create an HTML document using this method. html <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>createHTMLDocument() method</title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <p id="a"> HTML | DOM createHTMLDocument() method </p> <button onclick = "Geeks()"> Click Here </button> <script> function Geeks(){ var doc = document.implementation.createHTMLDocument("New Document"); var p = doc.createElement("p"); p.innerHTML = "GeeksforGeeks"; doc.body.appendChild(p); console.log(doc); } </script> </body> </html> Output: Before Button Click: After Button Click: Created document can be seen in the console. Supported Browsers: Google Chrome 1Edge 12Firefox 4Safari 1Opera 12.1Internet Explorer 9 Comment More infoAdvertise with us Next Article HTML DOM createHTMLDocument() Method T taran910 Follow Improve Article Tags : JavaScript Web Technologies HTML HTML-DOM Similar Reads HTML DOM createDocument() Method The DOMImplementation createDocument() method is used to create and return a Document. Syntax: var doc = document.implementation.createDocument(namespaceURI, qualifiedNameStr, docType); parameters: namespaceURI: It is a DOMString containing the namespace URI of the document to be created, or null if 1 min read HTML DOM createDocumentType() Method The DOMImplementation createDocumentType() method returns a Doctype object which can either be used with DOMImplementation createDocument() method for document creation or can be put into the document. Syntax: var doctype = document.implementation.createDocumentType(qualifiedNameStr, publicId, syste 1 min read HTML DOM createDocumentFragment() Method The createDocumentFragment() method in HTML DOM is used to create the document fragment which is useful for changing the content of the document such as deleting, modifying, or adding a new node. This method creates the document fragment, then appends the elements of the document to the document fra 2 min read HTML DOM appendChild() Method The HTML DOM appendChild() method adds a new child node to the end of a specified parent node's child list. It can move existing nodes or add new nodes, allowing dynamic updates to the document structure by appending elements, text, or other nodes.Syntax:node.appendChild(node);Parameters: This metho 3 min read HTML | DOM documentURI Property The documentURI property in HTML DOM used to set or return the location of a document. The return value is null If the document was created by the DocumentImplementation object or undefined. The documentURI property can be used on any document types. Syntax: Return the documentURI property: document 1 min read Like