Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 1.14 KB

shadowed.md

File metadata and controls

54 lines (30 loc) · 1.14 KB
layout tags
doc-api.html
argument-list, shadow-dom

ally.is.shadowed

Determines if an element is the descendant of a ShadowRoot.

Description

Usage

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

Arguments

Name Type Default Description
element HTMLElement required The 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. :::

Related resources

Contributing