Jenis properti HTML DOM Tautan
Definisi dan Penggunaan
ketik set properti atau tipe kembali (tipe MIME) dari dokumen terkait.
Tip: MIME-jenis Contoh: "text / css", " text / javascript", "image / gif", dan sebagainya.
tatabahasa
Jenis pengaturan atribut:
linkObject.type="MIME-type"
Pengembalian ketik atribut:
linkObject.type
Dukungan Browser
Semua browser utama mendukung atribut Jenis
contoh
contoh
Menampilkan terkait dokumen tipe MIME:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Link id = "link1" rel = "stylesheet" type = "text / css" href = "style1.css">
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "link1") ketik .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Tombol type = "button" onclick = "displayResult ()"> untuk menampilkan tipe MIME dari link elemen </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Link id = "link1" rel = "stylesheet" type = "text / css" href = "style1.css">
<Script>
Fungsi displayResult () {
var x = document.getElementById ( "link1") ketik .;
alert (x);
}
</ Script>
</ Kepala>
<Body>
<Tombol type = "button" onclick = "displayResult ()"> untuk menampilkan tipe MIME dari link elemen </ button>
</ Body>
</ Html>
Coba »
Link Objects