<title>菜鸟教程(runoob.com)</title>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map id="planetmap" name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
<p>点击按钮获取图像地图 area 元素的数目。</p>
<button onclick="myFunction()">点我</button>
var x = document.getElementById("planetmap").areas.length;
document.getElementById("demo").innerHTML = x;