Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM doctype Property

XML DOM doctype Property


Document Object Reference 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 Reference Document Object