For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages
are available by appending .md to any URL.
Interface MediaList
interface MediaList {
length: number;
mediaText: string;
"[iterator]"(): ArrayIterator<string>;
appendMedium(medium: string): void;
deleteMedium(medium: string): void;
item(index: number): string | null;
toString(): string;
[index: number]: string;
}
length: number;
mediaText: string;
"[iterator]"(): ArrayIterator<string>;
appendMedium(medium: string): void;
deleteMedium(medium: string): void;
item(index: number): string | null;
toString(): string;
[index: number]: string;
}
Indexable
-
[index: number]: string
Properties
Readonlylength
length: number
The read-only length property of the MediaList interface returns the number of media queries in the list.
mediaText
mediaText: string
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.
Methods
[iterator]
-
Returns ArrayIterator<string>
appendMedium
-
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.Parameters
- medium: string
Returns void
deleteMedium
-
The
deleteMedium()method of the MediaList interface removes from this MediaList the given media query.Parameters
- medium: string
Returns void
item
-
The
item()method of the MediaList interface returns the media query at the specified index, or null if the specified index doesn't exist.Parameters
- index: number
Returns string | null
toString
-
Returns string
The
MediaListinterface represents the media queries of a stylesheet, e.g., those set using a element's media attribute.MDN Reference