MDN self-hosted library · e01.org

MediaList: deleteMedium() method

CSSOM

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

  • NotFoundError 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.

const stylesheet = document.styleSheets[0];
stylesheet.media.deleteMedium("print");

Specifications

Browser compatibility