--- title: MediaQueryList.matches slug: Web/API/MediaQueryList/matches translation_of: Web/API/MediaQueryList/matches ---
La propiedad matches
de sólo lectura de la interfaz {{domxref ("MediaQueryList")}} es {{domxref ("Boolean")}} que devuelve true
si el {{domxref ("document")}} coincide actualmente con el medio lista de consultas, o false
si no.
var matches = MediaQueryList.matches;
A {{domxref("Boolean")}}; returns true
if the {{domxref("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 |
---|---|---|
{{SpecName("CSSOM View", "#dom-mediaquerylist-matches", "matches")}} | {{Spec2("CSSOM View")}} | Initial definition |
{{CompatibilityTable}}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 9 | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("6.0")}} | 10 | 12.1 | 5 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |