Tautkan Properti media
Contoh
Kembalikan jenis media yang dimaksudkan untuk elemen tautan:
var x = document.getElementById("myLink").media;
Definisi dan Penggunaan
Properti media menetapkan atau mengembalikan jenis media untuk elemen tautan.
Jenis media penting untuk informasi gaya. Gayanya mungkin berbeda untuk komputer dan perangkat seluler.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
media | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti media:
linkObject.media
Setel properti media:
linkObject.media = device
Nilai properti
Value | Description |
---|---|
all | For all devices. This is default |
aural | For speech synthesizers |
braille | For Braille tactile feedback devices |
embossed | For paged Braille printers |
handheld | For handheld devices |
For printed pages and print preview | |
projection | For projectors or transparencies |
screen | For color computer screens |
speech | For speech synthesizers |
tty | For teletype devices |
tv | For TV-type devices |
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili daftar jenis media yang dipisahkan koma |
---|
Lebih Banyak Contoh
Contoh
Ubah jenis media:
document.getElementById("myLink").media = "all";
Halaman Terkait
Referensi HTML: HTML <link> atribut media
Objek Tautan