Optional
parent: null | Target = documentOptional Element or EventTarget for parent.
Array of focusable elements in the optionally specified parent
.
HTML
<form action="" method="get" class="form-example">
<div class="form-example">
<label for="name">Enter your name: </label>
<input type="text" name="name" id="name" required />
</div>
<div class="form-example">
<label for="email">Enter your email: </label>
<input type="email" name="email" id="email" required />
</div>
<div class="form-example">
<input type="submit" value="Subscribe!" />
</div>
</form>
Code
const items = findAllFocusable("form");
// [<input id="name">, <input id="email">, <input type="submit">]
Searches for all focusable elements in either the
Document
(if noparent
specified) or the specifiedparent
.See this article for how focusable elements are determined.