W3cubDocs

/Web APIs

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
CompositionEvent 26 12 53 No 15 7 4.4 26 53 14 7 1.5

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/CompositionEvent