Introduced 3.1.0
3.1.0
Returns a list of focusable elements within a target, optionally also including the target (if it itself is also focusable)
Imagine this example HTML:
... <div id="modal"> <button id="modalClose">Close Modal</button> <h1>Hello World</h1> <p>Lorem ipsum <a href="/">link</a> dolor sit amet...</p> ... </div> ...
let modal = document.querySelector('#modal'); let focusable = getFocusableElements(modal); // [button#modalClose, a]
There was an error while loading. Please reload this page.