usemap
            收藏:0  
            阅读:47
        
        
        Image useMap 属性
定义和用法
useMap 属性可设置或者返回图片的 usemap 属性的值。
usemap 属性指定了一个图片的客户端图像映射 (一个可点击区域的图片映射)。
usemap属性与map元素名称的属性相关,两者可以 创建图像和地图之间的关联。
语法
		imageObject.useMap=value 
	
useMap 属性可以是以下值:
| 值 | 描述 | 
|---|---|
| #mapname | 一个哈希字符("#")加上map元素的名称 | 
浏览器支持
	![]()
![]()
![]()
![]()
 
所有主要浏览器都支持 useMap 属性
实例
返回客户端图片映射的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 is:
<script>
document.write(document.getElementById("planets").useMap);
</script>
</p>
</body>
</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 is:
<script>
document.write(document.getElementById("planets").useMap);
</script>
</p>
</body>
</html>