Created
December 13, 2021 18:00
-
-
Save jimmont/2ecafdff776e0142fe6c4b1b1639ccff to your computer and use it in GitHub Desktop.
interactive content HTML elements where tab through document gives focus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
needed to manage tab focus (focusin) events leading to the following selector to adjust; | |
reference | |
* https://html.spec.whatwg.org/multipage/dom.html#interactive-content | |
additional info: | |
* https://www.tpgi.com/using-the-tabindex-attribute/ | |
* https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex | |
and various linked/related in the above (or simply Google a bit) | |
*/ | |
function interactivecontent(node=document){ | |
// [tabindex] added for some contexts | |
return node.querySelectorAll(`[tabindex], a[href], audio[controls], button, details, embed, iframe, img[usemap], input, label, select, textarea, video[controls]`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment