MediaQueryListEvent: MediaQueryListEvent() constructor
The MediaQueryListEvent()
constructor creates a new MediaQueryListEvent
object.
Syntax
js
new MediaQueryListEvent(type)
new MediaQueryListEvent(type, options)
Parameters
Return value
A new MediaQueryListEvent
object.
Examples
js
const media = "(max-width: 600px)";
const matches = true;
const myMediaQueryListEvent = new MediaQueryListEvent("change", {
media,
matches,
});
Specifications
Specification |
---|
CSSOM View Module # dom-mediaquerylistevent-mediaquerylistevent |
Browser compatibility
BCD tables only load in the browser