This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.



Gets the locale name (language code, e.g., "en-US", "fr", "de", "ja", etc.) for the composition event, if available; otherwise, the empty string.

Property of dom/CompositionEventdom/CompositionEvent


Note: This property is read-only.

var localeName = event.locale;

Return Value

Returns an object of type StringString

The locale of the event.


function getLocale(e) {
//retrieve locale string for composition event
var localeString = e.locale;
return localeString;


For trusted events, the locale property is set for keyboard and Input Method Editor (IME) input only. The locale name is set from the default LCID of the thread, en-US, for example.

See also

Related pages