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 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 | Status | Comment |
---|---|---|
Document Object Model (DOM) Level 3 Events Specification The definition of 'CompositionEvent()' in that specification. |
Obsolete | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CompositionEvent() constructor | Chrome Full support Yes | Edge Full support 12 | Firefox Full support 53 | IE Full support Yes | Opera No support No | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 53 | Opera Android ? | Safari iOS ? | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
See also
CompositionEvent
, the interface of the objects it constructs.