Table of Contents

Class MediaList

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The MediaList interface represents the media queries of a stylesheet, e.g., those set using a link element's media attribute.

[Value("MediaList")]
public class MediaList
Inheritance
MediaList
Inherited Members

Remarks

NOTE

MediaList is a live list; updating the list using properties or methods listed below will immediately update the behavior of the document.

See also on MDN

Constructors

MediaList()

public MediaList()

Properties

Length

The read-only length property of the MediaList interface returns the number of media queries in the list.

[Value("length")]
public ulong Length { get; }

Property Value

ulong

A positive integer.

Remarks

MediaText

The mediaText property of the MediaList
interface is a stringifier that returns a string representing the
MediaList as text, and also allows you to set a new MediaList.

[Value("mediaText")]
public string MediaText { get; set; }

Property Value

string

A string representing the media queries of a stylesheet. Each one is
separated by a comma, for example
screen and (width >= 480px), print.If you wish to set new media queries on the document, the string value must have the
different queries separated by commas, e.g., screen, print. Note that the
MediaList is a live list; updating the list via
mediaText will immediately update the behavior of the
document.When set to the null value, that null value is converted to the empty string (""), so ml.mediaText = null is equivalent to ml.mediaText = "".

Remarks

Methods

AppendMedium(string)

The appendMedium() method of the MediaList interface adds a media query to the list. If the media query is already in the collection, this method does nothing.

[Value("appendMedium")]
public GlobalObject.Undefined AppendMedium(string medium)

Parameters

medium string

Returns

GlobalObject.Undefined

None (undefined).

Remarks

DeleteMedium(string)

The deleteMedium() method of the MediaList interface removes from this MediaList the given media query.

[Value("deleteMedium")]
public GlobalObject.Undefined DeleteMedium(string medium)

Parameters

medium string

Returns

GlobalObject.Undefined

None (undefined).

Remarks