The UIEvent() constructor creates a new UIEvent.


event = new UIEvent(typeArg [, UIEventInit])



Is a DOMString representing the name of the event.

UIEventInit Optional

Is a UIEventInit dictionary, having the following fields:

  • detail: optional and defaulting to 0, of type long, that is a event-dependant value associated with the event. UIEvent.detail lists the semantic for standard events.
  • view: optional and defaulting to null, of type WindowProxy, that is the Window associated with the event .
  • sourceCapabilities: An instance of the InputDeviceCapabilities interface which provides information about the physical device responsible for generating a touch event.

Note: The UIEventInit dictionary also accepts fields from the EventInit dictionary.


UI Events
# dom-uievent-uievent

Browser compatibility

BCD tables only load in the browser

See also

  • UIEvent, the interface of the objects it constructs.