ShadowRoot: innerHTML-Eigenschaft
Die innerHTML
-Eigenschaft des ShadowRoot
Interfaces setzt oder gibt eine Referenz auf den DOM-Baum innerhalb des
ShadowRoot
zurück.
Wert
Ein String.
Wenn der Wert auf null
gesetzt wird, wird dieser null
-Wert in den leeren String (""
) umgewandelt, sodass sr.innerHTML = null
gleichbedeutend mit sr.innerHTML = ""
ist.
Beispiele
js
let customElem = document.querySelector("my-shadow-dom-element");
let shadow = customElem.shadowRoot;
shadow.innerHTML = "<strong>This element should be more important!</strong>";
Spezifikationen
Specification |
---|
HTML # dom-shadowroot-innerhtml |
Browser-Kompatibilität
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.