x
 
<!DOCTYPE html>
<html>
<body>
<img src="/i/html/planets.jpg" width="215" height="260" usemap="#myMap">
<p>单击按钮可创建一个图像映射和一个带有 “venus.htm” 链接的 AREA 元素。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.createElement("MAP");
  x.setAttribute("id", "myMap");
  x.setAttribute("name", "myMap");
  document.body.appendChild(x);
  var y = document.createElement("AREA");
  y.setAttribute("href", "/demo/html/venus.html");
  y.setAttribute("shape", "circle");
  y.setAttribute("coords", "180,139,14");
  document.getElementById("myMap").appendChild(y);
  document.getElementById("demo").innerHTML = "MAP 已创建,您现在可以单击图像中的金星区域。";
}
</script>
</body>
</html>