The length property contains the number of Link objects that are in the document.links array.
<html> <a href="http://www.java2java.com">B Page</a><br> <a href="http://www.java2java.com">A Page</a><br> <script language="JavaScript"> <!-- document.write(document.links.length," links."); --> </script> </html>