! object (Object/HTML)

An object representing a <!DOCTYPE> DTD statement tag at the front of a document.

Availability:

DOM level - 1
JScript - 5.0
Internet Explorer - 5.0
Inherits from:Element object
JavaScript syntax:IEmyDoctype = myDocument.all.tags("!")[0]
IEmyDoctype = myDocument.all[anIndex]
IEmyDoctype = myDocument.getElementById(anElementID)
IEmyDoctype = myDocument.getElementsByName(aName)[anIndex]
IEmyDoctype = myDocument.doctype
IEmyDoctype = myDocument.getElementsByTagName("!")[anIndex]
HTML syntax:<!DOCTYPE aDocumentDescription>
Argument list:aDocumentDescriptionA reference to a DTD for this document
anIndexA reference to an element in a collection
aNameAn associative array reference
anElementIDThe ID value of an Element object
Object properties:accessKey, tabIndex
Event handlers:onClick, onDblClick, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp

The MSIE implementation creates an object that has a constructor name that suggests its class is "!". This is very odd, and if you intend to do any work on object classes, then naming a class with what might be interpreted as a special character in the script source may lead to some problems.

This is really a Doctype object and is specified in the DOM standard as a <!DOCTYPE> element.

The recommended means of access is to retrieve the value of the doctype property of the document you want to operate on. This is normally document.doctype for the current window but in the case of multiple frames, layers or windows you may be referring to the doctype of a different document object.

This object appears to inherit all of the properties of an HTML element.

See also:!.tabIndex, Document.doctype, Element object, Input.accessKey

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
accessKey n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a1 1 n/a n/a-
tabIndex n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/aWarning

Event nameJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
onClick n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onDblClick n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onHelp n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a n/aWarning
onKeyDown n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onKeyPress n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onKeyUp n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onMouseDown n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onMouseMove n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onMouseOut n/a5.0 5.0 n/a 5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onMouseOver n/a5.0 5.0 n/a5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning
onMouseUp n/a 5.0 5.0 n/a 5.0 5.0 n/a n/a n/a n/a n/a4.0 4.0Warning

Inheritance chain:

Element object, Node object