Area hash attribute

Definition and usage

hash Attribute sets or returns href attribute value anchor part.

href The attribute specifies the destination of the link in the defined area.

The anchor part is the part after the hash (#) in the URL.

Note:Do not include the hash (#) when this attribute is used to set the anchor part.

See also:

JavaScript Reference Manual:location.hash attribute

Example

Example 1

Return the anchor part of the URL of a specific area in the image map:

var x = document.getElementById("venus").hash;

Try it yourself

Example 2

Change the anchor part of a specific area in the image map:

document.getElementById("venus").hash = "newhashvalue";

Try it yourself

Syntax

Return hash attribute:

areaObject.hash

Set hash attribute:

areaObject.hash = anchorname

Halaga ng Atribute

Halaga Paglalarawan
anchorname Tinutukoy ang bahagi ng URL na nasa ibaba ng anchor.

Detalye ng Teknolohiya

Halaga ng Pagbabalik: Ang string na halaga, na naglalaman ng bahagi ng URL na nasa ibaba ng anchor, kasama ang simbolo ng tab (井号).

Suporta ng Browser

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Suporta Suporta Suporta Suporta Suporta