代码示例:(标识:hdom_document_links_1)
<html>
<body>
<img src="/static/demo/images/eg_planets.jpg" border="0" usemap="#planetmap" alt="Planets" />
<map name="planetmap" id="planetmap">
<area shape="circle"
coords="180,139,14"
href ="/static/demo/html/venus.html"
target ="_blank"
alt="Venus" />
<area shape="circle"
coords="129,161,10"
href ="/static/demo/html/mercur.html"
target ="_blank"
alt="Mercury" />
</map>
<br />
文档中链接数目是:
<script type="text/javascript">
document.write(document.links.length)
</script>
</body>
</html>