Skip to content

Instantly share code, notes, and snippets.

@kosinix
Last active January 2, 2016 08:58
Show Gist options
  • Select an option

  • Save kosinix/8279589 to your computer and use it in GitHub Desktop.

Select an option

Save kosinix/8279589 to your computer and use it in GitHub Desktop.
jQuery - Getting the currently focused element. Useful when debugging keyboard events on focused elements
jQuery(document).on('click', 'body', function( event ) {
console.log(document.activeElement);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment