2.2.1 [DOM Level 2 - Core] Section 1.2, Fundamental Interfaces

C0006:

The specification describes the getElementsByTagName and getElementsByTagNameNS methods on the Document interface.

IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

getElementsByTagName and getElementsByTagNameNS return a HTMLCollection rather than a NodeList.

C0001:

The specification states:

 Interface Document
  
 Attributes
 Doctype of type DocumentType, readonly
 The Document Type Declaration (see DocumentType) associated with this document. For 
 HTML documents as well as XML documents without a document type declaration this 
 returns null. The DOM Level 2 does not support editing the Document Type 
 Declaration. docType cannot be altered in any way, including through the use of 
 methods inherited from the Node interface, such as insertNode or removeNode.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The following clarifcations apply:

  • Because the DocumentType interface is not supported, the doctype attribute returns null.

  • The DocumentType instances in HTML documents are created as Comment instances and can be accessed using other DOM methods, typically document.firstChild.

C0002:

The specification states:

 Interface Document
  
 Method
 createComment
 Creates a Comment node given the specified string. 
  
 Parameters 
 data of type DOMString
 The data for the node.
  
 Return Value 
 Comment The new Comment object.
  
 No Exceptions

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

With the createComment method of the Document interface, the data parameter is treated as optional and creates a Comment Node even when no parameter is provided.

C0003:

The specification states:

 Interface Document
  
 Method
 createTextNode
 Creates a Text node given the specified string. 
  
 Parameters 
 data of type DOMString
 The data for the node.
  
 Return Value 
 Text The new Text object.
  
 No Exceptions

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The data parameter of the createTextNode method is treated as optional, and the createTextNode method creates a text node even when no parameter is provided.

C0004:

The specification states:

 Attributes
 length of type unsigned long, readonly
 The number of 16-bit units that are available through data and the substringData 
 method below. This may have the value zero, i.e., CharacterData nodes may be empty.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

Text nodes are not created when a node contains only white space. The length attribute is not available if the text node is not created.

C0005:

The specification states:

 Interface Element
  
 Attribute
 tagName of type DOMString, readonly 
 The name of the element. For example, in: 
 <elementExample id="demo"> 
  
 </elementExample> ,
 tagName has the value "elementExample". Note that this is case-preserving in XML, 
 as are all of the operations of the DOM. The HTML DOM returns the tagName of an 
 HTML element in the canonical uppercase form, regardless of the case in the source 
 HTML document.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The tagName property returns uppercase values except for elements with names that resemble namespaces (such as <test:elementName>) when a proprietary namespace has been declared. In this case, the tagName property drops the element prefixes and does not return uppercase values.

Show: