Determines if an element is considered tabbable and not focusable.
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.
var element = document.getElementById('victim'); var isOnlyTabbable = ally.is.onlyTabbable(element);
||required||The Element to test.|
The underlying rules can also be accessed in the
options argument style by calling
||required||The element to examine. The first element of a collection is used.|
||The Element to test.|
true if the element is only tabbable.
element argument is not of type
<object>elements in Internet Explorer are not considered only tabbable anymore.
v1.1.0exceptions can be passed to
v1.1.0the state of the
<object>element in which the currently examined element is hosted in is considered.
v1.1.0elements must be visible to be considered only tabbable.
v1.4.0SVG elements are no longer considered only tabbable in IE9+, Edge12+ and Firefox 51+.
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.
Even though SVG elements are focusable by script in Internet Explorer, they may lack the
.blur() methods. In order to safely manage focus for these elements use
# Related resources
ally.is.focusRelevantis used to identify elements that can receive focus
ally.is.focusableidentifies focusable elements
ally.is.tabbableidentifies keyboard focusable elements