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
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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event | Chrome Full support 1 | Edge Full support 12 | Firefox
Full support
63
| 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
63
| 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.