Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const elementIsInFocus = (el) => (el === document.activeElement);
elementIsInFocus(anyElement) // Result: If it is in focus, it will return True, otherwise it will return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment