查找图像映射区域的备用文本

  1. <html>
  2. <body>
  3.  
  4. <img src="/i/eg_planets.jpg"
  5. usemap="#planetmap" />
  6.  
  7. <map name="planetmap">
  8. <area id="venus" shape="circle"
  9. coords="180,139,14"
  10. alt="The planet Venus"
  11. href="/example/hdom/venus.html" />
  12. </map>
  13.  
  14. <p>"Venus" 的替代文本是:
  15. <script type="text/javascript">
  16. x=document.getElementById('venus');
  17. document.write(x.alt);
  18. </script>
  19. </p>
  20.  
  21. </body>
  22. </html>