The UIEvent() constructor creates a new UIEvent.

Syntax

 event = new UIEvent(typeArg, UIEventInit)

Values

typeArg
Is a DOMString representing the name of the event.
UIEventInitOptional
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 Specification
The definition of 'UIEvent()' in that specification.
Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 11IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 14Opera Android Full support YesSafari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

  • UIEvent, the interface of the objects it constructs.

Document Tags and Contributors

Contributors to this page: fscholz, jpmedley, teoli
Last updated by: fscholz,