web api event
Screen: change event
Limited availabilitySecure context
The change event of the Screen interface is fired on a specific screen when one or more of the following properties change on it:
Syntax
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("change", (event) => { })
onchange = (event) => { }
Event type
A generic Event.
Examples
const firstScreen = (await window.getScreenDetails()).screens[0];
firstScreen.addEventListener("change", (event) => {
console.log("The first screen has changed.", event, firstScreen);
});
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.