HTML DOM anchors 集合
定義和用法
anchors 集合可返回對文檔中所有 Anchor 對象的引用。
語法
document.anchors[]
實例
<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>