Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

Window: languagechange event

BaselineWidely available

Thelanguagechange event is fired at the global scope object when the user's preferred language changes.

Syntax

Use the event name in methods likeaddEventListener(), or set an event handler property.

js
addEventListener("languagechange", (event) => { })onlanguagechange = (event) => { }

Event type

A genericEvent.

Event handler aliases

In addition to theWindow interface, the event handler propertyonlanguagechange is also available on the following targets:

Examples

You can use thelanguagechange event in anaddEventListener method:

js
window.addEventListener("languagechange", () => {  console.log("languagechange event detected!");});

Or use theonlanguagechange event handler property:

js
window.onlanguagechange = (event) => {  console.log("languagechange event detected!");};

Specifications

Specification
HTML
# event-languagechange
HTML
# handler-window-onlanguagechange

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp