Properti tipe jangkar
Contoh
Kembalikan jenis MIME dari tautan tertentu:
var x =
document.getElementById("myAnchor").type;
Definisi dan Penggunaan
Properti tipe menetapkan atau mengembalikan nilai atribut tipe tautan.
Atribut type menentukan tipe MIME dari URL target di area tersebut.
Catatan: Atribut type adalah murni saran.
Catatan: Atribut type baru untuk elemen <a> di HTML5.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti tipe:
anchorObject.type
Setel properti tipe:
anchorObject.type = MIME-type
Nilai properti
Value | Description |
---|---|
MIME-type | Specifies the MIME type of the linked document. Look at IANA MIME types for a complete list of standard MIME types. |
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili tipe MIME dari dokumen yang ditautkan |
---|
Lebih Banyak Contoh
Contoh
Setel atribut tipe tautan ke teks/html:
document.getElementById("myAnchor").type = "text/html";
Halaman Terkait
Referensi HTML: HTML <a> jenis atribut
Objek Jangkar