Skip to content

Instantly share code, notes, and snippets.

@ryanve
Created March 3, 2017 21:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanve/6a702cbaada0a7772799a49c55ed6474 to your computer and use it in GitHub Desktop.
Save ryanve/6a702cbaada0a7772799a49c55ed6474 to your computer and use it in GitHub Desktop.
Log :focus element whenever focus changes
document.addEventListener('focusin', function() {
console.log(document.activeElement)
}, false)
@ryanve
Copy link
Author

ryanve commented Mar 3, 2017

Related: log-tab-focus.js

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