ShadowRoot

by 1 contributor:

This article is in need of a technical review.

This article is in need of an editorial review.

Our volunteers haven't translated this article into Afrikaans yet. Join us and help get the job done!

Draft
This page is not complete.

Use Element.attachShadow to create an instance of shadow DOM. When shadow DOM is created, it is always attached to an existing element. After the shadow DOM is created, the element that it is attached to is called the shadow root.

Syntax

var shadowroot = element.attachShadow(); 

Parameters

No parameters.

Result value

Returns a ShadowRoot.

Specifications

Specification Status Comment
Shadow DOM Working Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 45.0 Not supported Not supported ? Not supported
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support Not supported ? Not supported ? ? ? ? (Yes)

In Chrome 45, the ability to have multiple shadow roots was deprecated.

  • Create new recall
  • Q
  • A
 

Document Tags and Contributors

Contributors to this page: Dan-Dascalescu
Last updated by: Dan-Dascalescu,