HTMLContentElement

弃用
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

HTMLContentElement interface represents a <content> HTML Element, which is used in Shadow DOM .

特性

This interface inherits the properties of HTMLElement .

HTMLContentElement.select
DOMString that reflects the select HTML attribute. The value is a comma-separated list of CSS selectors that select the content to insert in place of the <content> 元素。

方法

This interface inherits the methods of HTMLElement .

HTMLContentElement.getDistributedNodes()
Returns a static NodeList of the distributed nodes associated with this <content> 元素。

规范

This feature is no longer defined by any standards.

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
HTMLContentElement
弃用 非标
Chrome 35 Edge ≤79 Firefox 28 — 59
Disabled
不支持 28 — 59
Disabled
Disabled From version 28 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 26 Safari No WebView Android 37 Chrome Android 37 Firefox Android 28 — 59
Disabled
不支持 28 — 59
Disabled
Disabled From version 28 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 26 Safari iOS ? Samsung Internet Android 3.0
getDistributedNodes
弃用 非标
Chrome 35 Edge ≤79 Firefox 28 — 59
Disabled
不支持 28 — 59
Disabled
Disabled From version 28 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 26 Safari No WebView Android 37 Chrome Android 37 Firefox Android 28 — 59
Disabled
不支持 28 — 59
Disabled
Disabled From version 28 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 26 Safari iOS ? Samsung Internet Android 3.0
select
弃用 非标
Chrome 35 Edge ≤79 Firefox 28 — 59
Disabled
不支持 28 — 59
Disabled
Disabled From version 28 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 26 Safari No WebView Android 37 Chrome Android 37 Firefox Android 28 — 59
Disabled
不支持 28 — 59
Disabled
Disabled From version 28 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 26 Safari iOS ? Samsung Internet Android 3.0

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
非标。预期跨浏览器支持较差。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
弃用。不要用于新网站。
用户必须明确启用此特征。
用户必须明确启用此特征。

另请参阅