CompositionEvent

The DOM CompositionEvent represents events that occur due to the user indirectly entering text.

Constructor

CompositionEvent()

Creates a new CompositionEvent object instance.

Properties

This interface also inherits properties of its parent, UIEvent, and its ancestor — Event.

CompositionEvent.data Read only

Returns the characters generated by the input method that raised the event; its varies depending on the type of event that generated the CompositionEvent object.

CompositionEvent.locale Read only

Returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with IME).

Methods

This interface also inherits methods of its parent, UIEvent, and its ancestor — Event.

CompositionEvent.initCompositionEvent()

Initializes the attributes of a 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
15
12
9
9
15
5
≤37
18
9
14
5
1.0
CompositionEvent
26
12
53
No
15
7
≤37
26
53
14
7
1.5
data
43
12
9
9
30
5
43
43
9
30
5
4.0
initCompositionEvent
15
12
9
9
15
5
37
18
9
14
5
1.5
locale
No
12-79
9
9
No
No
No
No
9
No
No
No

See also

© 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