fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <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"> </map> <p>点击按钮修改图像地图的名称。</p> <p id="demo"></p> <button onclick="myFunction()">点我</button> <script> function myFunction(){ document.getElementById("planetmap").name = "newMapName"; document.getElementById("demo").innerHTML = "name 属性的值从 'planetmap' 改为 'newMapName'."; } </script> </body> </html>
运行结果