ShadowRoot.host

La propriété host est une propriété en lecture seule, rattachée à l'interface ShadowRoot et qui représente une référence à l'élément du DOM auquel la racine ShadowRoot est attachée.

Syntaxe

var element = shadowRoot.host

Valeur

Un élément du DOM sous la forme d'un objet Element.

Exemples

let customElem = document.querySelector('mon-element-shadow-dom');
let shadow = customElem.shadowRoot;

  ...

// renvoie l'élément hôte
let hostElem = shadow.host;

Spécifications

Specification
DOM Standard
# dom-shadowroot-host

Compatibilité des navigateurs

BCD tables only load in the browser