Skip to content

ally.js

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

🔗ally.is.validTabindex

Determines if an element's tabindex attribute value is sound

🔗Usage

var element = document.getElementById('victim');
var isValidTabindex = ally.is.validTabindex(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.

🔗Notes

NOTE: empty tabindex [tabindex=""] parsed and exposed as [tabindex="-32768"] - Trident 1072965
WARNING: invalid tabindex value makes element focusable - Gecko 1128054
WARNING: Gecko, Blink and WebKit consider [tabindex="3x"] valid
WARNING: only Blink and WebKit respect the tabindex attribute on SVGElements (defined in SVG 2)

🔗Related resources

🔗Contributing