Created
October 22, 2022 19:45
-
-
Save oguzhancvdr/ba62171731efa394dc0bc241b065af58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elementIsInFocus = (el) => (el === document.activeElement); | |
// Returns true if the element is in focus, otherwise returns false | |
elementIsInFocus(anyElement) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Detect if an element is in focus