说明:自己试试看
效果:
代码:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效---显示页面的所有链接</title>
<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.outerHTML+"</font><br>")
}
}
//-->
</script>
</head>
<body>
<input type="button" onClick="extractlinks()" value="显示所有的连接">
<p> </p>
<p><a target="_blank" href="http://www.idchonor.com/html/">连接1</a></p>
<p><a target="_blank" href="http://www.idchonor.com/html/">连接1</a></p>
<p><a target="_blank" href="http://www.idchonor.com/html/">连接1</a></p>
<p>连接1</p>
<p>连接1</p>
<p>连接1</p>
<p>连接1</p>
</body>
</html>
