ally.is.activeElement

March 17, 2016 ยท View on GitHub

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

NameTypeDefaultDescription
elementHTMLElementrequiredThe 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

Contributing