The HTML specification does not say this except :
The HTMLUnknownElement interface should be used for HTML elements that are not defined by this specification (or other applicable specifications).
This can be verified according to browsers using the following JavaScript code in the console:
Object.prototype.toString.call(document.createElement("foo"));
However, some browsers either do not follow the specification given here. For example, Chrome 13 provides [object HTMLElement]
, IE 8 gives [object HTMLGenericElement]
(IE 9 is true).
As far as I know, all browsers will parse <foo>
as an element, but the default style and behavior are not guaranteed to be the same. Where HTMLUnknownElement
is implemented and the specification is respected, it must be inherited directly from HTMLElement
and, therefore, has many default properties found for other elements.
Please note that your HTML will not check when you have non-standard elements in your markup. It is also worth mentioning that search robots, screen readers and other software will not be able to extract semantic meaning from these elements.
Further reading:
source share