Web/API/UIEvent/UIEvent

From Get docs


The UIEvent() constructor creates a new UIEvent.

Syntax

event = new UIEvent(typeArg [, UIEventInit])

Values

typeArg

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.

The UIEventInit dictionary also accepts fields from the EventInit dictionary.


Specifications

Specification Status Comment
InputDeviceCapabilities Draft Added sourceCapabilities property.
Document Object Model (DOM) Level 3 Events SpecificationThe definition of 'UIEvent()' in that specification. Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
UIEvent() constructor Chrome

Full support Yes

Edge

Full support ≤18

Firefox

Full support 11

IE

?

Opera

Full support Yes

Safari

?

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 14

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown


See also

  • UIEvent, the interface of the objects it constructs.