查找区域的 href

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function changeLink()
  5. {
  6. document.getElementById('venus').href="http://www.yousite.com"
  7. }
  8. </script>
  9. </head>
  10. <body>
  11.  
  12. <p>请点击金星(Venus):</p>
  13. <img src="/i/eg_planets.jpg"
  14. usemap="#planetmap" />
  15.  
  16. <map name="planetmap">
  17. <area
  18. id="venus"
  19. shape="circle"
  20. coords="180,139,14"
  21. href ="/example/html/venus.html"
  22. alt="Venus" />
  23. </map>
  24.  
  25. <input type="button" onclick="changeLink()" value="改变链接" />
  26.  
  27. </body>
  28. </html>