CompositionEvent: CompositionEvent() constructor

The CompositionEvent() constructor creates a new CompositionEvent object.

Syntax

js
new CompositionEvent(type)
new CompositionEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to compositionstart, compositionupdate, or compositionend.

options Optional

An object that, in addition of the properties defined in UIEvent(), has the following properties:

data Optional

A string used to initialize the data property of the new CompositionEvent. Browser-generated events set it to the characters generated by the IME composition.

Return value

A new CompositionEvent object.

Specifications

Specification
UI Events
# dom-compositionevent-compositionevent

Browser compatibility

BCD tables only load in the browser

See also