The languagechange
event is fired at the global scope object when the user's preferred language changes.
Bubbles | No |
---|---|
Cancelable | No |
Interface | Event |
Event handler | onlanguagechange |
Examples
You can use the languagechange
event in an addEventListener
method:
window.addEventListener('languagechange', function() { console.log('languagechange event detected!'); });
Or use the onlanguagechange
event handler property:
window.onlanguagechange = function(event) { console.log('languagechange event detected!'); };
Specification
Specification | Status |
---|---|
HTML Living Standard The definition of 'languagechange' in that specification. |
Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
languagechange event | Chrome Full support 37 | Edge Full support ≤79 | Firefox Full support 32 | IE No support No | Opera Full support 24 | Safari ? | WebView Android Full support 37 | Chrome Android Full support 37 | Firefox Android Full support 4 | Opera Android Full support 24 | Safari iOS ? | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown