---
title: matchMedium
framework: webkitjs
role: symbol
role_heading: Instance Method
path: webkitjs/stylemedia/1634038-matchmedium
---

# matchMedium

Evaluates the given string as a media query and returns the result.

## Declaration

```data
boolean matchMedium(
    optional DOMString mediaquery
);
```

## Parameters

- `mediaquery`: The media query to evaluate.

## Return Value

Return Value true if the media query is logically true; otherwise, false.

## Discussion

Discussion For example, window.styleMedia.matchMedium("(color)") returns true if the display device is a color device. You can also use this method to check whether the browser supports 3D transforms as follows: if ('styleMedia' in window && window.styleMedia.matchMedium("(-webkit-transform-3d)")) {   // Insert 3D code here } Or check to see whether the browser supports animations as follows: if ('styleMedia' in window && window.styleMedia.matchMedium("(-webkit-animation)")) {   // Insert animation code here }
