Name
activeElement — NN n/a IE 4 DOM n/a
Synopsis
Read-only
Reference to the object that currently has focus in the document. To learn more about the object, you’ll need to examine the object’s name or other properties. Because buttons and other elements do not receive focus on the Macintosh, the returned value of this property may vary with operating system.
Example
var currObj = document.activeElement
Value
Document object reference.
Default
window
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.