Area hash 屬性

Area 對象參考手冊 Area 對象

定義和用法

hash 屬性克設置或者返回 href 屬性值得錨部分。

語法

areaObject.hash=anchorname


流覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要流覽器都支持 hash 屬性


實例

實例

下麵的例子可返回 "Venus" 區域中href屬性的錨部分:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>IT研修(xuhuhu.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>

以上實例輸出結果:

金星href屬性的錨: #description



Area 對象參考手冊 Area 對象