Nama host area Properti
Contoh
Kembalikan nama host URL untuk area tertentu dalam peta gambar:
var x =
document.getElementById("venus").hostname;
Definisi dan Penggunaan
Properti hostname menyetel atau mengembalikan bagian hostname dari nilai atribut href.
Atribut href menentukan tujuan tautan di suatu area.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
hostname | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti nama host:
areaObject.hostname
Setel properti nama host:
areaObject.hostname = hostname
Value | Description |
---|---|
hostname | Specifies the hostname of a URL |
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili nama domain (atau alamat IP) dari URL |
---|
Lebih Banyak Contoh
Contoh
Ubah nama host area tertentu dalam peta gambar:
document.getElementById("venus").host = "www.example.com";
Halaman Terkait
Referensi JavaScript: location.hostname Property
Objek Daerah