HTML DOM useMap 属性
定义和用法
useMap 属性可设置或返回图像的 usemap 属性的值。
语法
- imageObject.useMap=URL
实例
下面的例子可输出客户端图像映射的 usemap 属性的值:
- <html>
- <body>
- <img id="planets" src="planets.gif"
- width="145" height="126"
- usemap="#planetmap" />
- <map name="planetmap">
- <area id="venus" shape="circle"
- coords="124,58,8"
- alt="The planet Venus"
- href="venus.htm" />
- </map>
- <p>The value of the usemap attribute=
- <script type="text/javascript">
- x=document.getElementById('planets');
- document.write(
x.useMap
);- </script>
- </p>
- </body>
- </html>