The CompositionEvent()
constructor creates a new CompositionEvent
object instance.
CompositionEvent()
Syntax
new CompositionEvent(typeArg) 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 theCompositionEvent
object to the characters generated by the IME composition.
Note: The
CompositionEventInit
dictionary inherits from theUIEventInit
dictionary, so can also accept members defined on there. -
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–2021 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