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 |
DOMThe definition of 'Window.event' in that specification. | Living Standard | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event
|
Chrome
Full support 1 |
Edge
Full support 12 |
Firefox Full support 66 Full support 66 Full support 63 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 |
IE
Full support 4 |
Opera
Full support 7 |
Safari
Full support 1.1 |
WebView Android
Full support 1 |
Chrome Android
Full support 18 |
Firefox Android Full support 66 Full support 66 Full support 63 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 |
Opera Android
Full support 10.1 |
Safari iOS
Full support 1 |
Samsung 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
Window.event by Mozilla Contributors is licensed under CC-BY-SA 2.5.