From cae99e1a2307d1e9ed4a97caa6d02b84624c888f Mon Sep 17 00:00:00 2001 From: wbamberg Date: Wed, 22 Jan 2025 15:43:37 -0800 Subject: [PATCH] Update files/en-us/web/api/window/matchmedia/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- files/en-us/web/api/window/matchmedia/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/files/en-us/web/api/window/matchmedia/index.md b/files/en-us/web/api/window/matchmedia/index.md index 2830b8a3a4c8cd4..9b7be742801bac0 100644 --- a/files/en-us/web/api/window/matchmedia/index.md +++ b/files/en-us/web/api/window/matchmedia/index.md @@ -24,6 +24,7 @@ matchMedia(mediaQueryString) - `mediaQueryString` - : A string specifying the media query to parse into a {{domxref("MediaQueryList")}}. + > [!NOTE] > Just like in CSS, any [media feature](/en-US/docs/Web/CSS/@media#media_features) must be wrapped in parentheses inside the expression. For example: `matchMedia('(max-width: 600px)')` will work, whereas `matchMedia('max-width: 600px')` will not. Keywords for media types (`all`, `print`, `screen`) and logical operators (`and`, `or`, `not`, `only`) do not need to be wrapped in parentheses.