Document.activeElement

  • Revision slug: DOM/document.activeElement
  • Revision title: document.activeElement
  • Revision id: 61029
  • Created:
  • Creator: drdeteck
  • Is current revision? No
  • Comment 5 words added; page display name changed to 'document.activeElement'

Revision Content

{{ DomRef() }}

Summary

Returns the currently focused element. Attribute is read only.

{{ Note("This attribute is part of the in-development HTML 5 specification.") }}

Syntax

var curElement = document.activeElement;

Example

Specification

Focus management

{{ languages( { "es": "es/DOM/element.activeElement", "fr": "fr/DOM/document.activeElement", "ja": "ja/DOM/document.activeElement", "pl": "pl/DOM/document.activeElement" } ) }}

Revision Source

<p>{{ DomRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>Returns the currently focused element. Attribute is read only.</p>
<p>{{ Note("This attribute is part of the in-development HTML 5 specification.") }}</p>
<h3 name="Syntax">Syntax</h3>
<pre class="eval">var curElement = document.activeElement;
</pre>
<h3 name="Example">Example</h3>
<h3 name="Specification">Specification</h3>
<p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#focus-management">Focus management </a></p>

<p>{{ languages( { "es": "es/DOM/element.activeElement", "fr": "fr/DOM/document.activeElement", "ja": "ja/DOM/document.activeElement", "pl": "pl/DOM/document.activeElement" } ) }}</p>
Revert to this revision