HTMLSourceElement: Eigenschaft media
Die media
-Eigenschaft des HTMLSourceElement
-Interfaces ist ein String, der das vorgesehene Zielmedium für die Ressource darstellt. Der Wert ist eine media query, die eine kommagetrennte Liste von Medientypen, Medien-Features und logischen Operatoren ist.
Sie spiegelt das media
-Attribut des <source>
-Elements wider.
Wert
Ein String.
Beispiele
html
<source
id="el"
src="largeVideo.mov"
type="video/quicktime"
media="screen and (min-width: 600px)" />
js
const el = document.getElementById("el");
console.log(el.media); // Output: "screen and (min-width: 600px)"
el.media = "(min-width: 800px)"; // Updates the media value
Spezifikationen
Specification |
---|
HTML # dom-source-media |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
media |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.