Skip to content

Instantly share code, notes, and snippets.

@AndreasJacobsen
Created May 10, 2020 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreasJacobsen/10ad9a79cf2ba744e9dfcae62b511984 to your computer and use it in GitHub Desktop.
Save AndreasJacobsen/10ad9a79cf2ba744e9dfcae62b511984 to your computer and use it in GitHub Desktop.
Tab navigation HTML checker, this snippet prints the HTML for all elements reachable by the tab key.
function checkTabPress(e) {
if (e.keyCode === 9) {
console.log(e.target)
}
}
let body = document.querySelector('body');
body.addEventListener('keyup', checkTabPress);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment