🔗ally.is.onlyTabbable
Determines if an element is considered tabbable and not focusable.
🔗Description
An element is considered tabbable and not focusable if the element is part of the document's focus navigation sequence, but cannot be focused by script.
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 isOnlyTabbable = ally.is.onlyTabbable(element);
🔗Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| element | HTMLElement | required | The Element to test. |
🔗Returns
Boolean, true if the element is focus relevant.
🔗Throws
TypeError if element argument is not of type HTMLElement.
🔗Changes
- Since
v#masterall<object>elements in Internet Explorer are not considered only tabbable anymore.
🔗Notes
NOTE: there is no way to feature detect if an element is tabbable or not. The
Element.tabIndex property gives some indication, but ultimately user agent sniffing (via platform.js) is done internally to fix mismatches.🔗Related resources
ally.is.focusRelevantis used to identify elements that can receive focusally.is.focusableidentifies focusable elementsally.is.tabbableidentifies keyboard focusable elements