The Document interface has a hasFocus() method which returns a boolean value indicating whether the document or any element inside the document has focus. This method can be used to determine whether the active element in a document has focus.
See more results on Neeva
Summaries from the best pages on the web
In HTML document, the document.hasfocus( ) the method is used for indicating whether an element or document has the focus or not. The function returns a true ...
HTML | DOM hasFocus() Method - GeeksforGeeks
Description: Selects element if it is currently focused. If you are looking for the currently focused element, $( document.activeElement ) will retrieve it ...
:focus Selector | jQuery API Documentation