AttachShadow

Element.AttachShadow method

Creates shadow root and attaches it to current element.

public ShadowRoot AttachShadow(ShadowRootMode mode)
Parameter Type Description
mode ShadowRootMode Mode in which shadow root will be created.

Return Value

Created ShadowRoot.

Exceptions

exception condition
Error NotSupportedError: Element does not support shadow tree.
Error InvalidStateError: Element already has shadow tree.

See Also