JS的document.anchors函数使用示例
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>JS的document.anchors函数使用示例</title> </head> <body> <a name="first">First anchor</a><br /> <a name="second">Second anchor</a><br /> <a name="third">Third anchor</a><br /> <br /> <h3>所有锚链接的集合是:</h3> <script type="text/javascript"> console.log(document.anchors); console.log(document.anchors.length); console.log(document.anchors[0]); </script> </body> </html>