Firefox Tomorrow

web api instance method

MediaList: deleteMedium() method

View on MDN ↗

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

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.