HTMLHtmlElement

HTMLHtmlElement 接口是给定HTML文档的根节点。它继承了 HTMLElement 对象的属性和方法

您可以通过读取document.documentElement属性的值来获取文档的 HTMLHtmlElement对象

属性

继承 HTMLElement的属性。

HTMLHtmlElement.version 
Is a DOMString representing the version of the HTML Document Type Definition (DTD) that governs this document. This property should not be used any more as it is non-conforming. Simply omit it.

Methods

No specific method; inherits methods from its parent, HTMLElement.

Specifications

Specification Status Comment
WHATWG HTML Living Standard
HTMLHtmlElement
Living Standard Live specification, no change since last snapshot
HTML5.1
HTMLHtmlElement
Working Draft No change since the last snapshot
HTML5
HTMLHtmlElement
Recommendation The version element has been removed, as it is non-conforming.
Document Object Model (DOM) Level 2 HTML Specification
HTMLHtmlElement
Recommendation Reflecting the element change in HTML 4.01 Specification, the version property is now deprecated.
Document Object Model (DOM) Level 1 Specification
HTMLHtmlElement
Recommendation Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)

See also

  • HTML element implementing this interface: <html>.

文档标签和贡献者