Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active July 27, 2020 22:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save davidgilbertson/0f23a53e1ec1f43f425bbb0df9db3336 to your computer and use it in GitHub Desktop.
Save davidgilbertson/0f23a53e1ec1f43f425bbb0df9db3336 to your computer and use it in GitHub Desktop.
function handleFirstTab(e) {
if (e.keyCode === 9) { // the "I am a keyboard user" key
document.body.classList.add('user-is-tabbing');
window.removeEventListener('keydown', handleFirstTab);
}
}
window.addEventListener('keydown', handleFirstTab);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment