ShadowRoot: innerHTML プロパティ
innerHTML
は ShadowRoot
インターフェイスのプロパティで、 ShadowRoot
の内部の DOM ツリーに対する参照を設定したり返したりします。
値
文字列です。
例
js
let customElem = document.querySelector("my-shadow-dom-element");
let shadow = customElem.shadowRoot;
shadow.innerHTML = "<strong>This element should be more important!</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.