From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/fr/web/api/element/attachshadow/index.html | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 files/fr/web/api/element/attachshadow/index.html (limited to 'files/fr/web/api/element/attachshadow') diff --git a/files/fr/web/api/element/attachshadow/index.html b/files/fr/web/api/element/attachshadow/index.html new file mode 100644 index 0000000000..97ac7f7019 --- /dev/null +++ b/files/fr/web/api/element/attachshadow/index.html @@ -0,0 +1,54 @@ +--- +title: Element.attachShadow() +slug: Web/API/Element/attachShadow +translation_of: Web/API/Element/attachShadow +--- +

{{APIRef('Shadow DOM')}} {{SeeCompatTable}}

+ +

La méthode Element.attachShadow() attache un arbre Shadow DOM à un élément spécifié et retourne une référence à son ShadowRoot.

+ +

Syntaxe

+ +
var shadowroot = element.attachShadow(shadowRootInit);
+
+ +

Paramètres

+ +
+
shadowRootInit
+
Un dictionnaire ShadowRootInit, avec les propriétés suivantes : +
    +
  • mode : une chaîne de caractères spécifiant le mode d'encapsulation de l'arbre du Shadow DOM, parmi les options suivantes : +
      +
    • open : spécifie une encapsulation ouverte.
    • +
    • closed : spécifie une encapsulation fermée.
    • +
    +
  • +
+
+
+ +

Retour

+ +

Retourne un {{domxref("ShadowRoot")}}.

+ +

Spécifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Shadow DOM', '#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict', 'attachShadow()')}}{{Spec2('Shadow DOM')}}Définition initiale.
+ +

Browser compatibility

+ +

{{Compat("api.Element.attachShadow")}}

-- cgit v1.2.3-54-g00ecf