CompositionEvent.CompositionEvent()

The CompositionEvent() constructor creates a new CompositionEvent object instance.

Syntax

const myEvent = new CompositionEvent(typeArg [, CompositionEventInit])

Values

typeArg
Is a DOMString representing the name of the event.
CompositionEventInit Optional

A CompositionEventInit dictionary object, which can contain the following members:

data
Initializes the data attribute of the CompositionEvent object to the characters generated by the IME composition.

Note: The CompositionEventInit dictionary inherits from the UIEventInit dictionary, so can also accept members defined on there.

Specifications

Specification
UI Events
# dom-compositionevent-compositionevent

Browser compatibility

BCD tables only load in the browser

See also