Jangkar rel Properti
Contoh
Kembalikan nilai atribut rel dari tautan:
var x = document.getElementById("myAnchor").rel;
Definisi dan Penggunaan
Properti rel menetapkan atau mengembalikan nilai atribut rel dari sebuah tautan.
Atribut rel menentukan hubungan antara dokumen saat ini dan dokumen yang ditautkan.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
rel | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti rel:
anchorObject.rel
Setel properti rel:
anchorObject.rel = "value"
Nilai properti
Value | Description |
---|---|
alternate | An alternate version of the document (i.e. print page, translated or mirror) |
author | The author of the document |
bookmark | A related document |
help | A help document |
licence | Copyright information for the document |
next | The next document in a selection |
nofollow | "nofollow" is used by Google, to specify that the Google search spider should not follow that link (mostly used for paid links) |
noreferrer | Specifies that the browser should not send a HTTP referer header if the user follows the hyperlink |
prefetch | Specifies that the target document should be cached |
prev | The previous document in a selection |
search | A search tool for the document |
tag | A tag (keyword) for the current document |
Detail Teknis
Nilai Kembali: | Sebuah String, mewakili hubungan antara dokumen saat ini dan dokumen yang ditautkan |
---|
Lebih Banyak Contoh
Contoh
Setel nilai atribut rel ke "nofollow":
document.getElementById("myAnchor").rel = "nofollow";
Halaman Terkait
Referensi HTML: HTML <a> atribut rel
Objek Jangkar