Skip to content

Instantly share code, notes, and snippets.

@defmech
Last active December 4, 2019 14:35
Show Gist options
  • Save defmech/a5a4cac2b1bb7b8d66939c4196bec12f to your computer and use it in GitHub Desktop.
Save defmech/a5a4cac2b1bb7b8d66939c4196bec12f to your computer and use it in GitHub Desktop.
Here’s a handy snippet if you are debugging website accessibility. Logs out the element that currently has focus.
window.addEventListener('keyup', (event: KeyboardEvent) => {
if (event.key === "Tab") {
console.log('document.activeElement', document.activeElement);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment