Name

DOMImplementation — global DOM methods

Synopsis

The DOMImplementation object defines methods that are not specific to any particular Document object but rather are “global” to an implementation of the DOM. You can obtain a reference to the DOMImplementation object through the implementation property of any Document object.

Methods

Document createDocument(string namespace, string qualifiedName, DocumentType doctype)

This method creates and returns a new XML Document object. If qualifiedName is specified, a root element with that name is created and added to the document as its documentElement. If qualifiedName includes a namespace prefix and a colon, namespace should be the URI that uniquely identifies the namespace. If the doctype argument is non-null, the ownerDocument property of this DocumentType object is set to the newly created document and the DocumentType node is added to the new document.

DocumentType createDocumentType(string qualifiedName, publicId, systemId)

This method creates and returns a new DocumentType node to represent a <!DOCTYPE> declaration that you can pass to createDocument().

Document createHTMLDocument(string title)

This method creates a new HTMLDocument object with a skeletal document tree that includes the specified title. The documentElement property of the returned object is an <html> element, and this root element has <head> and <body> tags as its children. The <head> element in turn has a <title> child, which has the specified title string as its child. ...

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.