Skip to content

Instantly share code, notes, and snippets.

@ryanve
Last active May 17, 2024 01:56
Show Gist options
  • Save ryanve/2d85662234a13248b459 to your computer and use it in GitHub Desktop.
Save ryanve/2d85662234a13248b459 to your computer and use it in GitHub Desktop.
Log :focus element each time tab key is pressed
document.addEventListener('keyup', function(e) {
9 != e.keyCode || e.metaKey || e.ctrlKey || console.log(document.activeElement)
}, false)
@ryanve
Copy link
Author

ryanve commented Mar 3, 2017

Related: log-focus.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment