The window event property returns the event which is currently being handled by the site’s code in the current window.
event = window.event;
Return Value: This property returns the event object currently being handled.
Example: In this example, we will get the event type using this property.
Before Clicking Button:
After Clicking Button:
In Console, the event object is:
- Google Chrome
- Internet Explorer