HTML DOM
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
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
