ally.is.shadowed

September 28, 2016 ยท View on GitHub

Determines if an element is the descendant of a ShadowRoot.

Description

Usage

var element = document.getElementById('victim');
var isShadowed = ally.is.shadowed(element);

Arguments

NameTypeDefaultDescription
elementHTMLElementrequiredThe Element to test.

Returns

Boolean, true if the element is hosted in a ShadowRoot.

Throws

TypeError if element argument is not of type HTMLElement.

Examples

Notes

:::note Requires ShadowDOM support. :::

Contributing