document.write(document.anchors.length)
<a name="first">第一个锚</a> <br> <a name="second">第二个锚</a> <br> <a name="third">第三个锚</a> <br> <br> 文档中锚的数目: