Link media-eigenschap

Definitie en gebruik

media Eigenschap instellen of teruggeven link-element van het media-type.

Media-type is belangrijk voor stijlinformatie. Bijvoorbeeld, de stijl voor computers en mobiele apparaten kan verschillend zijn.

Zie ook:

HTML Referentiemanual:HTML <link> media attribute

HTML Referentiemanual:HTML <link> tag

Voorbeeld

Voorbeeld 1

Geef het media-type van het link-element terug:

var x = document.getElementById("myLink").media;

Probeer het zelf uit

Voorbeeld 2

Verander het media-type:

document.getElementById("myLink").media = "all";

Probeer het zelf uit

Syntaxis

Geef de media-eigenschap terug:

linkObject.media

Stel de media-eigenschap in:

linkObject.media = device

Eigenschapswaarde

Waarde Beschrijving
all Gebruikt voor alle apparaten. Standaard.
aural For speech synthesizers.
braille Gebruikt voor braille tactile feedback apparaten.
embossed Gebruikt voor embosste braille printers.
handheld Gebruikt voor handhoude apparaten.
print Gebruikt voor pagina's afdrukken en afdrukvoorbeeld.
projection For projectors or transparent slides.
screen For color computer screens.
speech For speech synthesizers.
tty For teletype printers.
tv For television-type devices.

Technical details

Return value: String value, representing a list of media types separated by commas.

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support