English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM activeElement Property

HTML DOM Document Object

activeElementA read-only property that returns the current focus element in the document.

Syntax:

document.activeElement
var x = document.activeElement.tagName;
Test and See‹/›

Browser Compatibility

The numbers in the table specify the first browser version that fully supports the activeElement property:

Property
activeElement239.644

Technical Details

Return Value:Reference to the element object that has the focus in the document
DOM Version:DOM Level3

HTML DOM Document Object