The CompositionEvent()
constructor creates a new CompositionEvent
object.
On this page
CompositionEvent: CompositionEvent() constructor
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
, orcompositionend
. 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 newCompositionEvent
. 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
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
CompositionEvent
, the interface of the objects it constructs.
© 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