hasFocus
Description
The hasFocus of Document for JS returns true if key events are being routed through or to the document; otherwise, returns false. Roughly speaking, this corresponds to the document, or a document nested inside this one, being focused.
Syntax
document.hasFocus()
Examples
1 · false
2 · true
Links
Document
- adoptNode
- body
- characterSet
- close
- compatMode
- contentType
- cookie
- createCDATASection
- createComment
- createDocumentFragment
- createElement
- createElementNS
- createProcessingInstruction
- createTextNode
- currentScript
- defaultView
- designMode
- dir
- doctype
- Document
- documentElement
- documentURI
- domain
- embeds
- exitPictureInPicture
- forms
- getElementsByClassName
- getElementsByName
- getElementsByTagName
- getElementsByTagNameNS
- head
- hidden
- images
- implementation
- importNode
- lastModified
- links
- location
- onreadystatechange
- onvisibilitychange
- open
- parseHTMLUnsafe
- pictureInPictureEnabled
- plugins
- readyState
- referrer
- scripts
- title
- URL
- visibilityState
- write
- writeln