CompositionEvent

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2017.

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

Event UIEvent CompositionEvent

Constructor

CompositionEvent()

Creates a new CompositionEvent object instance.

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 Deprecated Non-standard

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

Instance methods

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

CompositionEvent.initCompositionEvent() Deprecated

Initializes the attributes of a CompositionEvent object.

Specifications

Specification
UI Events
# interface-compositionevent

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
CompositionEvent
CompositionEvent() constructor
data
initCompositionEvent
Deprecated
locale
DeprecatedNon-standard

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.

See also