focusableChildren

Commons
stable

Return all focusable descendant elements inside a container. By default filters out elements with tabIndex="-1" so only tab-reachable elements are included.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

el
required
Element
The container element to query.
filterByTabIndex
boolean
true
When true (default) elements with tabindex="-1" are excluded. Pass false to include all focusable elements regardless of tab order.

API

Return value

The value returned by this util.

Ordered array of focusable HTMLElements inside the container.

Usage

Examples

Ready-to-paste usage snippets.

List all tab-reachable children

typescript