MediaList: deleteMedium() method
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("CSSOM")}}
The deleteMedium() method of the {{DOMxRef("MediaList")}} interface removes from this MediaList the given media query.
Syntax
js-nolint
deleteMedium(medium)Parameters
medium- : A string containing the media query to remove from the list.
Return value
None (undefined).
Exceptions
NotFoundError{{domxref("DOMException")}}- : 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.
js
const stylesheet = document.styleSheets[0];
stylesheet.media.deleteMedium("print");Specifications
{{Specifications}}
Browser compatibility
{{Compat}}