<!-- 把如下代碼加入<body>區域中 --> <script language="JavaScript1.2"> <!-- function extractlinks(){ var links=document.all.tags("A") var total=links.length var win2=window.open("","","menubar,scrollbars,toolbar") win2.document.write("<font size='2'>一共有"+total+"個連接</font><br>") for (i=0;i<total;i++){ win2.document.write("<font size='2'>"+links[i].outerHtml+"</font><br>") } } //--> </script> <input type="button" onClick="extractlinks()" value="顯示所有的連接">