CSSOM
The deleteMedium() method of the MediaList interface removes from this MediaList the given media query.
Syntax
deleteMedium(medium)
Parameters
medium- : A string containing the media query to remove from the list.
Return value
None (undefined).
Exceptions
NotFoundErrorDOMException- : Thrown when the media query to remove is not in the list.
Examples
The following removes the media query print from the
MediaList associated with the first stylesheet applied to the current document.
const stylesheet = document.styleSheets[0];
stylesheet.media.deleteMedium("print");
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
