Window.event
Window
の読み取り専用プロパティである event
は、現在サイトのコードが処理している Event
を返します。イベントハンドラーのコンテキスト外では、値が常に undefined
になります。
新しいコードではこのプロパティの使用を避けるべきであり、代わりにイベントハンドラー関数になる Event
を使用してください。このプロパティは広くサポートされておらず、またサポートされていてもコードが壊れやすくなるおそれがあります。
メモ:
このプロパティは、返された Event
が期待する値ではない状況になる場合があり、壊れやすい可能性があります。加えて Window.event
は、shadow trees で発生したイベントに対して不適格です。
仕様
Specification |
---|
DOM # dom-window-event |
ブラウザー実装状況
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Deprecated. Not for use in new websites.
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.