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

{{Compat("api.MediaQueryList.matches")}}

See also