HTML DOM noHref 屬性
定義和用法
noHref 屬性可設(shè)置或返回某個(gè)區(qū)域是活動(dòng)的還是非活動(dòng)的。
語(yǔ)法
areaObject.noHref=true|false
說(shuō)明
<area> 標(biāo)簽的 nohref 屬性在客戶端圖像映射中定義了一個(gè)對(duì)鼠標(biāo)敏感的區(qū)域,而該區(qū)域不會(huì)在用戶選取它時(shí)采取任何操作。你必須為每個(gè) <area> 標(biāo)簽都包含一個(gè) href 或 nohref 屬性。
實(shí)例
下面的例子可返回圖像映射中 "Venus" 區(qū)域的 "noHref" 狀態(tài):
<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" />
</map>
<p>noHref status:
<script type="text/javascript">
x=document.getElementById('venus');
document.write(x.noHref
);
</script>
</p>
</script>
</body>
</html>