<!DOCTYPE html>
<html>
<head>
<title>js23.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
function getLinks(){
//alert(document.links.length + "个链接");//得到链接个数的函数
for(var i=0; i<document.links.length;i++){
alert(document.links[i]);
}
}
</script>
</head>
<body>
<a href = "http://www.baidu.com">Baidu</a><br>
<a href = "http://www.google.com">Google</a><br>
<a href = "http://www.yahoo.com">Yahoo</a><br>
<input type = "button" value = "链接" onclick = "getLinks();"/>
</body>
</html>
说明:links返回对所有link引用。