<html> <body> <a name="A">First anchor</a><br /> <a name="B">Second anchor</a><br /> <a name="C">Third anchor</a><br /> <br /> Number of anchors in this document: <script type="text/javascript"> document.write(document.anchors.length) </script> </body> </html>