HTML DOM noHref 属性

定义和用法

noHref 属性可设置或返回某个区域是活动的还是非活动的。

语法

  1. areaObject.noHref=true|false

说明

<area> 标签的 nohref 属性在客户端图像映射中定义了一个对鼠标敏感的区域,而该区域不会在用户选取它时采取任何操作。你必须为每个 <area> 标签都包含一个 href 或 nohref 属性。

实例

下面的例子可返回图像映射中 "Venus" 区域的 "noHref" 状态:

  1. <html>
  2. <body>
  3.  
  4. <img src="planets.gif"
  5. width="145" height="126"
  6. usemap="#planetmap" />
  7.  
  8. <map name="planetmap">
  9. <area id="venus" shape="circle"
  10. coords="124,58,8"
  11. alt="Venus"
  12. href="venus.htm" />
  13. </map>
  14.  
  15. <p>noHref status:
  16. <script type="text/javascript">
  17. x=document.getElementById('venus');
  18. document.write(x.noHref);
  19. </script>
  20. </p>
  21.  
  22. </script>
  23. </body>
  24. </html>