x
 
<!DOCTYPE html>
<html>
<body>
<img src="/i/html/planets.jpg" width="215" height="260" alt="Planets" usemap="#planetmap">
<map id="planetmap" name="planetmap">
  <area shape="rect" coords="0,0,110,260" alt="Sun" href="/demo/tags/sun.html">
  <area shape="circle" coords="129,161,10" alt="Mercury" href="/demo/tags/mercur.html">
  <area shape="circle" coords="180,139,14" alt="Venus" href="/demo/tags/venus.html">
</map>
<p>单击按钮可更改图像映射的名称。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("planetmap").name = "newMapName";
  document.getElementById("demo").innerHTML = "name 属性的值已从 “planetmap” 更改为 “newMapName”。";
}
</script>
</body>
</html>