Get link infomation in a paragraph
<html> <head> <script language="JavaScript"> <!-- var linkText = ""; function showLinks() { var item = 1; linkText = "LINK INDEX:\n" + "____________\n"; for (n=0; n < document.links.length; n++) { linkText += item + ". " + document.links[n] + "\n"; item ++; } alert(linkText); } //--> </script> <title>An introduction to the Web</title> </head> <body><basefont size=4> <font size="+1">A</font>N <font size="+1">I</font>NTRODUCTION <font size="+1">T</font>O <font size="+1">T</font>HE <font size="+1">W</font>EB<hr> <a href="http://www.java2s.com">www.java2s.com</a> <a href="http://www.java2s.com">hyperlinks</a><p> <form><input type="button" value="Quick Link Index" onClick="showLinks()"></form> </body> </html>