Area href Properti
Contoh
Ubah URL tautan di suatu area:
document.getElementById("venus").href = "sun.htm";
Definisi dan Penggunaan
Properti href menetapkan atau mengembalikan nilai atribut href dari suatu area.
Atribut href menentukan tujuan tautan di suatu area.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
href | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti href:
areaObject.href
Setel properti href:
areaObject.href = URL
Nilai properti
Value | Description |
---|---|
URL |
Specifies the hyperlink target for the area. Possible values:
|
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili URL link. Mengembalikan seluruh URL, termasuk protokol (seperti http://) |
---|
Lebih Banyak Contoh
Contoh
Dapatkan URL tautan di suatu area:
var x =
document.getElementById("venus").href;
Contoh
Ubah URL tautan di suatu area menjadi URL absolut:
document.getElementById("venus").href = "http://www.cnn.com/";
Halaman Terkait
Referensi HTML: HTML <area> atribut href
Objek Daerah