Latest web development tutorials

XML DOM doctype property

Document Object Reference Document Object

Definition and Usage

doctype property returns the document associated with the document type declaration (DTD, stands for Document Type Declaration).

For XML documents without a DTD, it returns null.

The property provides DocumentType objects directly accessible (Document of a child node).

grammar

documentObject.doctype


Examples

The following code fragment uses loadXMLDoc () to " note_internal_dtd.xml " into xmlDoc and return DocumentType objects:

Examples

xmlDoc=loadXMLDoc("note_internal_dtd.xml");
document.write(xmlDoc.doctype);

Output:

[object DocumentType]

try it"

Document Object Reference Document Object