attach_shadow method

attach_shadow

Creates shadow root and attaches it to current element.

Returns

Created ShadowRoot.

def attach_shadow(self, mode):
    ...
ParameterTypeDescription
modeaspose.html.dom.ShadowRootModeMode in which shadow root will be created.

Exceptions

ExceptionDescription
ErrorNotSupportedError: Element does not support shadow tree.
ErrorInvalidStateError: Element already has shadow tree.

See Also