<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效代码|www.webjx.com|---显示页面的所有链接</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[i].outerHTML+"</font><br>")
}
}
//-->
</script>
</head>
<body>
<input type="button" onClick="extractlinks()" value="显示所有的连接">
<p></p>
<p><a target="_blank" href="http://www.webjx.com/">连接1</a></p>
<p><a target="_blank" href="http://www.webjx.com/">连接1</a></p>
<p><a target="_blank" href="http://www.webjx.com/">连接1</a></p>
<p>连接1</p>
<p>连接1</p>
<p>连接1</p>
<p>连接1</p>
</body>
</html>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]