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


Creates a new CompositionEvent object instance.


This interface also inherits properties of its parent, UIEvent, and its ancestor — Event. 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).


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

Initializes the attributes of a CompositionEvent object.


Specification Status Comment
UI Events
The definition of 'CompositionEvent' in that specification.
Working Draft  
Document Object Model (DOM) Level 3 Events Specification
The definition of 'CompositionEvent' in that specification.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes Yes9 Yes No ?
data Yes Yes9 Yes No ?
initCompositionEvent Yes Yes9 Yes No ?
locale Yes Yes9 Yes No ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support ? ? Yes9 ? ? ?
data ? ? Yes9 ? ? ?
initCompositionEvent ? ? Yes9 ? ? ?
locale ? ? Yes9 ? ? ?

See also

Document Tags and Contributors

Last updated by: connorshea,