--- title: MediaQueryList.matches slug: Web/API/MediaQueryList/matches translation_of: Web/API/MediaQueryList/matches ---
{{APIRef("CSSOM View")}}

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.

Sintaxis

var matches = MediaQueryList.matches;

Value

A {{domxref("Boolean")}}; returns true if the {{domxref("document")}} currently matches the media query list, false if not.

Examples

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

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

Specifications

Specification Status Comment
{{SpecName("CSSOM View", "#dom-mediaquerylist-matches", "matches")}} {{Spec2("CSSOM View")}} Initial definition

Browser compatibility

{{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}}

See also