Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Window.matchMedia()

3 tags 1 category

The Window interface’s matchMedia() method returns a new MediaQueryList object that can then be used to determine if the document matches the media query string, as well as to monitor the document to detect when it matches (or stops matching) that media query.

Inputs: mediaQueryString A string specifying the media query to parse into a MediaQueryList.

Inputs: Just like in CSS, any media feature must be wrapped in parentheses inside the expression. For example: matchMedia(“(width <= 600px)”) or matchMedia(“(orientation: landscape)”) work, whereas matchMedia(“width < 600px”) or matchMedia(“orientation: landscape”) do not. Keywords for media types (all, print, screen) and logical operators (and, or, not, only) do not need to be wrapped in parentheses.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…