Doctype object (Object/DOM)

An object that represents the document type DTD.

Availability:

DOM level - 1
JavaScript - 1.5
JScript - 5.5
Internet Explorer - 5.5
Netscape - 6.0
Inherits from:Node object
JavaScript syntax:IEmyDoctype = myDocument.all.anElementID
IEmyDoctype = myDocument.all.tags("DOCTYPE")[anIndex]
IEmyDoctype = myDocument.all[aName]
-myDoctype = myDocument.doctype
-myDoctype = myDocument.getElementById(anElementID)
-myDoctype = myDocument.getElementsByName(aName)[anIndex]
-myDoctype = myDocument.getElementsByTagName("DOCTYPE")[anIndex]
HTML syntax:<!DOCTYPE>
Argument list:anIndexA reference to an element in a collection
aNameAn associative array reference
anElementIDThe ID value of an Element object
Object properties:name
Collections:entities[], notations[]

Every document should own a Doctype object according to the DOM level 1 specification. This object encapsulates name and some collections that describe the DTD. Work is still underway on standardizing the XML and DTD requirements and this object is therefore likely to change in later versions of the DOM specification.

The DOM level 2 specification adds the following new properties:

See also:Document.doctype, Element.document, Notation object

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
name1.5 1.55.5 5.56.0 6.05.5 5.5 n/a n/a n/a1 1 n/a n/aReadOnly

Inheritance chain:

Node object