XML DOM doctype Property
Document Object
Definition and Usage
The doctype property returns the document type declaration (DTD, short for Document Type Declaration) associated with the document.
For an XML document without a DTD, it returns null.
This property provides direct access to the DocumentType Object(a child node of Document).
Syntax
documentObject.doctype
Example
The following code snippet uses loadXMLDoc() to load "note_internal_dtd.xml" Load into xmlDoc, and return the DocumentType object:
Example
xmlDoc=loadXMLDoc("note_internal_dtd.xml");
document.write(xmlDoc.doctype);
Output:
[object DocumentType]
Try it »
Document Object