HTML DOM Document activeElement property
- Προηγούμενη Σελίδα all[]
- Επόμενη Σελίδα addEventListener()
- Επιστροφή στο Προηγούμενο Επίπεδο Σώματα Documents HTML DOM
Definition and usage
activeElement
The property returns the HTML element that has the focus.
activeElement
The property is read-only.
See also:
Example
Get the currently focused element:
const element = document.activeElement.tagName;
Syntax
document.activeElement
Return value
Type | Description |
---|---|
Element | The HTML element that has the focus. |
Browser support
document.activeElement
It is a DOM Level 1 (1998) feature.
All browsers fully support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Υποστήριξη | 9-11 | Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη |
- Προηγούμενη Σελίδα all[]
- Επόμενη Σελίδα addEventListener()
- Επιστροφή στο Προηγούμενο Επίπεδο Σώματα Documents HTML DOM