UIEvent: UIEvent() constructor
The UIEvent() constructor creates a new UIEvent object.
Note: If you construct a synthetic event using this constructor, that event will not be trusted, for security reasons.
Only browser-generated UIEvent objects are trusted and only trusted events trigger default actions.
Syntax
js
new UIEvent(type)
new UIEvent(type, options)
Parameters
type-
A string with the name of the event. It is case-sensitive and browsers set it to
load,unload,abort,error, orselect. optionsOptional-
An object that, in addition of the properties defined in
Event(), can have the following properties:detailOptional-
A number that is an event-dependent value associated with the event. It defaults to
0andUIEvent.detaillists the semantic for standard events. viewOptional-
The
Windowassociated with the event. Its default value isnull. sourceCapabilitiesOptional Non-standard-
An
InputDeviceCapabilitiesobject which provides information about the physical device responsible for generating a touch event.
Result value
A new UIEvent object.
Specifications
| Specification |
|---|
| UI Events # dom-uievent-uievent |
Browser compatibility
BCD tables only load in the browser
See also
UIEvent, the interface of the objects it constructs.