Get to know MDN better
The UIEvent interface represents simple user interface events. It is part of the UI Events API, which includes various event types and interfaces related to user interactions.
UIEvent derives from Event. Although the UIEvent.initUIEvent() method is kept for backward compatibility, you should create a UIEvent object using the UIEvent() constructor.
Several interfaces are direct or indirect descendants of this one: MouseEvent, TouchEvent, FocusEvent, KeyboardEvent, WheelEvent, InputEvent, and CompositionEvent.
Event UIEventCreates a UIEvent object.
This interface also inherits properties of its parent, Event.
UIEvent.detail Read onlyReturns a long with details about the event, depending on the event type.
UIEvent.sourceCapabilities Read onlyReturns an instance of the InputDeviceCapabilities interface, which provides information about the physical device responsible for generating a touch event.
UIEvent.view Read onlyReturns a WindowProxy that contains the view that generated the event.
UIEvent.which Read onlyReturns the numeric keyCode of the key pressed, or the character code (charCode) for an alphanumeric key pressed.
This interface also inherits methods of its parent, Event.
UIEvent.initUIEvent()Initializes a UIEvent object. If the event has already been dispatched, this method does nothing.
| UI Events # idl-uievent |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Feb 9, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.