ShadowRoot:innerHTML 属性
ShadowRoot
接口的 innerHTML
属性用于设置或返回 ShadowRoot
内部 DOM 树的引用。
值
一个字符串。
示例
js
let customElem = document.querySelector("my-shadow-dom-element");
let shadow = customElem.shadowRoot;
shadow.innerHTML = "<strong>此元素应当具有更高的优先级!</strong>";
规范
Specification |
---|
HTML # dom-shadowroot-innerhtml |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
innerHTML | ||||||||||||
Can be set with a TrustedHTML instance |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.