MDN’s new design is in Beta! A sneak peek:

This page is not complete.

This feature has been removed from the Web standards. Though some browsers may still support it, it is in the process of being dropped. Avoid using it and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Use Element.createShadowRoot 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.

This method has been deprecated in favor of attachShadow.


var shadowroot = element.createShadowRoot(); 


No parameters.

Result value

Returns a ShadowRoot.


This feature is no longer defined by any specifications.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 35.0 No support No support 22 No support
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support No support ? ? ? ? ? ? (Yes)

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

Document Tags and Contributors

 Contributors to this page: DomenicDenicola, Keysox, japacible, jpmedley, markg, Sebastianz
 Last updated by: DomenicDenicola,