HTML DOM Area hash property
Definition and Usage
g hash property sets or returns the anchor part of the href attribute worth.
grammar
areaObject.hash=anchorname
Browser Support
All major browsers support hash property
Examples
Examples
The following example returns "Venus" anchor section area of the href attribute:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm#description">
</map>
<p>金星href属性的锚:
<script>
document.write(document.getElementById("venus").hash);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm#description">
</map>
<p>金星href属性的锚:
<script>
document.write(document.getElementById("venus").hash);
</script>
</p>
</body>
</html>
Examples of the above output:
金星href属性的锚: #description
try it"
Area objects