Area noHref 屬性

定義和用法
noHref 屬性可設置或返回 某區域的 nohref 屬性值。
nohref 屬性指定一個區域沒有相關鏈接.
提示: nohref 屬性通知流覽器超鏈接 屬性不存在。你也可以不使用 href 屬性來更簡單的設置沒有相關鏈接。
語法
areaObject.noHref=true|false
流覽器支持
除了 IE 流覽器,所有主流流覽器都支持 noHref 屬性。
實例
實例
下麵的例子可返回圖像映射中 "Venus" 區域的 "noHref" 屬性:
<html>
<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"
nohref="nohref">
</map>
<p>Value of nohref attribute for the "Venus" area is:
<script>
document.write(document.getElementById("venus").noHref);
</script>
</p>
</body>
</html>
<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"
nohref="nohref">
</map>
<p>Value of nohref attribute for the "Venus" area is:
<script>
document.write(document.getElementById("venus").noHref);
</script>
</p>
</body>
</html>
以上實例輸出結果:
Value of nohref attribute for the "Venus" area is: true
