Window.event

The read-only Window property event returns the Event which is currently being handled by the site's code. Outside the context of an event handler, the value is always undefined.

You should avoid using this property in new code, and should instead use the Event passed into the event handler function. This property is not universally supported and even when supported introduces potential fragility to your code.

Note: This property can be fragile, in that there may be situations in which the returned Event is not the expected value. In addition, Window.event is not accurate for events dispatched within shadow trees.

Specifications

Specification Status Comment
DOM
The definition of 'Window.event' in that specification.
Living Standard Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
eventChrome Full support 1Edge Full support 12Firefox Full support 63
Notes Disabled
Full support 63
Notes Disabled
Notes This was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756).
Disabled From version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Full support 4Opera Full support 7Safari Full support 1.1WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 63
Notes Disabled
Full support 63
Notes Disabled
Notes This was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756).
Disabled From version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 1.0

Legend

Full support
Full support
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also