Skip to content

Latest commit

 

History

History
56 lines (29 loc) · 1.18 KB

active-element.md

File metadata and controls

56 lines (29 loc) · 1.18 KB
layout tags
doc-api.html
argument-list, shadow-dom

ally.is.activeElement

Determines if an element is the activeElement of its host context, i.e. its document, iFrame or ShadowHost.

Description

Usage

var element = document.getElementById('victim');
var isActiveElement = ally.is.activeElement(element);

Arguments

Name Type Default Description
element HTMLElement required The Element to test.

Returns

Boolean, true if the element is the activeElement of its host context.

Throws

TypeError if element argument is not of type HTMLElement.

Examples

Changes

  • Added in v1.1.0.

Notes

Related resources

Contributing