HTML DOM anchors 集合
定義和用法
anchors 集合可返回對(duì)文檔中所有 Anchor 對(duì)象的引用。
語(yǔ)法
document.anchors[]
實(shí)例
<html> <body> <a name="first">First anchor</a><br /> <a name="second">Second anchor</a><br /> <a name="third">Third anchor</a><br /> <br /> Number of anchors in this document: <script type="text/javascript"> document.write(document.anchors.length) </script> </body> </html>