document.all

草案
本页尚未完工.

已废弃 HTML5
该特性已经从 Web 标准中删除,虽然一些浏览器目前仍然支持它,但也许会在未来的某个时间停止支持,请尽量不要使用该特性。

Document 接口上的一个只读属性。返回一个 HTMLAllCollection,包含了页面上的所有元素。

语法

var htmlAllCollection = document.all;

返回一个 HTMLAllCollection,包含了页面上的所有元素。

规范

规范 状态 评论
HTML Living Standard
all
Living Standard Initial definition.
Defined in the obsolete and legacy APIs section.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
all
Non-standard
Chrome Full support 64
Notes
Full support 64
Notes
Notes Starting in Chrome 65, this property is readonly.
Notes Before Chrome 64, this property was accessed through the HTMLDocument alias.
Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support 64
Notes
Full support 64
Notes
Notes Starting in Chrome 65, this property is readonly.
Notes Before Chrome 64, this property was accessed through the HTMLDocument alias.
Chrome Android Full support 64
Notes
Full support 64
Notes
Notes Starting in Chrome 65, this property is readonly.
Notes Before Chrome 64, this property was accessed through the HTMLDocument alias.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
See implementation notes.
See implementation notes.