javascript get focusable elements
/**
* Gets keyboard-focusable elements within a specified element
* @param {HTMLElement} [element=document] element
* @returns {Array}
*/
function getKeyboardFocusableElements (element = document) {
return [...element.querySelectorAll(
'a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'
)]
.filter(el => !el.hasAttribute('disabled'))
}
Also in JavaScript:
- what is 5+5
- deleteOne mongoose
- ionic (Emitted value instead of an instance of Error
- disable input angular
- jquery data
- validate array javascript
- react chrome extension
- floor in js
- javascript glow
- imagebackground with input inot avoiding react native
- js insertbefore
- number format reactjs
- localstorage.getitem()
- js get first 3 characters of string
- click select option to update div jquery
- build react app
- check if js is enabled
- js array map skip element
- redux action to hit api and assign data in stateless component
- fetch composition API in Vue3
- delete element html javascript
- jquery if checkbox is checked
- get data from api in javascript
- vuejs directives list