Area hashProperty
Area Object
Definition and Usage
The hash property can set or return the anchor part of the href attribute value.
Syntax
areaObject.hash=anchorname
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the hash property.
Example
Example
The following example returns the anchor part of the href attribute in the "Venus" area:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
</head>
<body>
<img src="planets.gif.html" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm.html">
</map>
<p>Anchor of the Venus href attribute:
<script>
document.write(document.getElementById("venus").hash);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
</head>
<body>
<img src="planets.gif.html" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm.html">
</map>
<p>Anchor of the Venus href attribute:
<script>
document.write(document.getElementById("venus").hash);
</script>
</p>
</body>
</html>
The output result of the above example is:
Anchor of the Venus href attribute: #description
Try it yourself »
Area Object Other Extensions