In JavaScript, the DOMActivate event fires when an element becomes active — for example when it is clicked with the mouse or activated with a keypress (MDN).
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for DOMActivate. Start with this line.
JavaScript
addEventListener("DOMActivate", fn)
Call
What it does
addEventListener("DOMActivate", fn)
Primary signature.
Built into the browser. Listen with el.addEventListener("DOMActivate", …) — no import required.
Library declarations
JavaScript
addEventListener("DOMActivate", fn)
Parameters
Parameter
Description
Event name
Required. "DOMActivate" (case-sensitive)
Return Value
Return Value
Description
*
Fires as an Element event (listener receives the Event object).
JavaScript Examples
Example 1 — Show detail (MDN)
Legacy demo: update the button text from event.detail.
Listen for click. Standard activation for buttons and links.
Run your logic there. Mouse, touch, and keyboard activate share this path.
Skip DOMActivate. MDN: avoid Deprecated features in new projects.
Migrate old code by renaming the event string to "click".
Compatibility
Browser Support
ElementDOMActivate is marked Deprecated on MDN. Do not add it to new code — migrate to click. Support is incomplete and shrinking.
✓ Deprecated
DOMActivate
Legacy UIEvent when an element becomes active — study only, prefer click.
—Deprecated
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
DOMActivateDeprecated
Bottom line: Use addEventListener only (no onDOMActivate). Prefer click for mouse, touch, and keyboard activation.
Frequently Asked Questions
It fires when an element becomes active — for example when it is clicked with the mouse or activated with a keypress (MDN). Prefer the standard click event in new code.
MDN marks Element DOMActivate as Deprecated only — not Experimental and not Non-standard. Avoid it in new projects; it may be removed from standards or browsers.
No. MDN states there is no onDOMActivate event handler property. Use addEventListener("DOMActivate", …) only if you must support legacy code.
A UIEvent (inherits from Event). The detail property may always be 0, or behave like click’s detail (click count), depending on the browser (MDN).
Prefer the standard click event for activation. It works with mouse, many touch gestures, and keyboard activation on buttons and links.
Some modern browsers no longer dispatch it. Treat missing events as expected for a Deprecated API — migrate to click.