HTML DOM Document hasFocus()
HTML DOM Document hasFocus() Property
The hasFocus() method is used to return true if the document has focus or any of its elements has focus. Otherwise, it will return false.
Syntax:-
Its syntax is:- document.hasFocus()
Return:-
Its return is:- true if a document or any of its elements has focus else false