web api instance property
HTMLStyleElement: media property
The HTMLStyleElement.media property specifies the
intended destination medium for style information.
Value
A string describing a single medium or a comma-separated list.
Examples
Suppose the <head> contains the following:
<style id="inline-style" media="screen, print">
p {
color: blue;
}
</style>
Then:
const style = document.getElementById("inline-style");
console.log(style.media); // 'screen, print'
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.