Skip to content

Instantly share code, notes, and snippets.

@brianarn
Created June 6, 2017 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brianarn/59126ca48f02ae6224baa6fe043a4e29 to your computer and use it in GitHub Desktop.
Save brianarn/59126ca48f02ae6224baa6fe043a4e29 to your computer and use it in GitHub Desktop.
Track focused element
(function () {
var focusedElement;
setInterval(function () {
if (focusedElement !== document.activeElement) {
focusedElement = document.activeElement;
console.log('Focused element changed:', focusedElement);
}
}, 50);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment