Skip to content

ally.js

JavaScript library to help modern web applications with accessibility concerns by making accessibility simpler

🔗ally.is.focusable

Determines if an element is considered focusable.

🔗Description

An element is considered focusable if it is ally.is.focusRelevant, ally.is.visible and not ally.is.disabled.

Consult the data tables what browsers consider focusable and what ally.js considers focusable to learn how HTML elements behave.

🔗Usage

var element = document.getElementById('victim');
var isFocusable = ally.is.focusable(element);

🔗Arguments

NameTypeDefaultDescription
elementHTMLElementrequiredThe Element to test.

🔗Returns

Boolean, true if the element is focus relevant.

🔗Throws

TypeError if element argument is not of type HTMLElement.

🔗Changes

🔗Notes

See ally.is.focusRelevant

🔗Related resources

🔗Contributing