The MediaQueryListEvent constructor creates a new MediaQueryListEvent instance.


var myMqlEvent = new MediaQueryListEvent(init);



An init object that defines features of the new object instance. The available properties are:

  • media: A DOMString representing a serialized media query.
  • matches: A Boolean representing the media query status — true if it matches, false if not.


var media = '(max-width: 600px)';
var matches = true;

var myMediaQueryListEvent = new MediaQueryListEvent({media, matches});


Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'MediaQueryListEvent()' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
MediaQueryListEvent() constructorChrome Full support YesEdge Full support ≤79Firefox Full support 55IE No support NoOpera Full support YesSafari Full support 14WebView Android No support NoChrome Android Full support YesFirefox Android Full support 55Opera Android Full support YesSafari iOS Full support 14Samsung Internet Android Full support Yes


Full support  
Full support
No support  
No support

See also