HTML DOM Image useMap property
Definition and Usage
Value useMap property sets or returns the picture usemap property.
usemap attribute specifies the picture of a client-side image maps (clickable image map areas).
usemap attributes and attribute names associated map element, the two can create an association between the images and maps.
grammar
imageObject.useMap=value
useMap property can have the following values:
值 | 描述 |
---|---|
#mapname | 一个哈希字符("#")加上map元素的名称 |
Browser Support
All major browsers support useMap property
Examples
Examples
Returns property values usemap client image maps:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<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>usemap属性的值:
<script>
document.write(document.getElementById("planets").useMap);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<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>usemap属性的值:
<script>
document.write(document.getElementById("planets").useMap);
</script>
</p>
</body>
</html>
try it"
Image Object