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

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.
Obsolete  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 9IE Full support YesOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 9Opera Android ? Safari iOS ? Samsung Internet Android ?
CompositionEvent() constructorChrome Full support YesEdge ? Firefox Full support 53IE Full support YesOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support 53Opera Android ? Safari iOS ? Samsung Internet Android ?
dataChrome Full support YesEdge Full support YesFirefox Full support 9IE Full support YesOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 9Opera Android ? Safari iOS ? Samsung Internet Android ?
initCompositionEvent
DeprecatedNon-standard
Chrome Full support YesEdge Full support YesFirefox Full support 9IE Full support YesOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 9Opera Android ? Safari iOS ? Samsung Internet Android ?
locale
DeprecatedNon-standard
Chrome Full support YesEdge Full support YesFirefox Full support 9IE Full support YesOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 9Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also

Document Tags and Contributors

Last updated by: connorshea,