代码示例:(标识:hdom_document_anchors_1)
<html>
<body>

<a name="first">第一个锚</a><br />
<a name="second">第二个锚</a><br />
<a name="third">第三个锚</a><br />
<br />

文档中锚的数目:
<script type="text/javascript">
document.write(document.anchors.length)
</script>

</body>
</html>
运行结果: