The CompositionEvent()
constructor creates a new CompositionEvent
object.
The CompositionEvent()
constructor creates a new CompositionEvent
object.
js
new CompositionEvent(type) new CompositionEvent(type, options)
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.
A new CompositionEvent
object.
Specification |
---|
UI Events # dom-compositionevent-compositionevent |
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 |
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