This is a snapshot of an early working draft and has therefore been superseded by the HTML standard.

This document will not be further updated.


Call For Comments — 27 October 2007

2.6. APIs in HTML documents

For HTML documents, and for HTML elements in HTML documents, certain APIs defined in DOM3 Core become case-insensitive or case-changing, as sometimes defined in DOM3 Core, and as summarised or required below. [DOM3CORE].

This does not apply to XML documents or to elements that are not in the HTML namespace despite being in HTML documents.

Element.tagName, Node.nodeName, and Node.localName

These attributes return tag names in all uppercase and attribute names in all lowercase, regardless of the case with which they were created.


The canonical form of HTML markup is all-lowercase; thus, this method will lowercase the argument before creating the requisite element. Also, the element created must be in the HTML namespace.

This doesn't apply to Document.createElementNS(). Thus, it is possible, by passing this last method a tag name in the wrong case, to create an element that claims to have the tag name of an HTML element, but doesn't support its interfaces, because it really has another tag name not accessible from the DOM APIs.


When an Attr node is set on an HTML element, it must have its name lowercased before the element is affected.

This doesn't apply to Document.setAttributeNodeNS().


When an attribute is set on an HTML element, the name argument must be lowercased before the element is affected.

This doesn't apply to Document.setAttributeNS().

Document.getElementsByTagName() and Element.getElementsByTagName()

These methods (but not their namespaced counterparts) must compare the given argument case-insensitively when looking at HTML elements, and case-sensitively otherwise.

Thus, in an HTML document with nodes in multiple namespaces, these methods will be both case-sensitive and case-insensitive at the same time.


If the new namespace is the HTML namespace, then the new qualified name must be lowercased before the rename takes place.