La propiedad matches de s√≥lo lectura de la interfaz MediaQueryList es Boolean que devuelve true si el document coincide actualmente con el medio lista de consultas, o false si no.


var matches = MediaQueryList.matches;


A Boolean; returns true if the document currently matches the media query list, false if not.


var mql = window.matchMedia('(max-width: 600px)');

if(mql.matches) {
  // media query test returning true


Specification Status Comment
CSS Object Model (CSSOM) View Module
La definición de 'matches' en esta especificación.
Working Draft Initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 9 (Yes) 6.0 (6.0) 10 12.1 5
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? (Yes) ? ? ? ? ?

See also