HTML DOM links 集合

定义和用法

links 集合可返回对文档中所有 Area 和 Link 对象的引用。

语法

document.links[]

实例

<html>
<body>

<img src=/w3c/jsref/"planets.gif" __width="145" height="126" __usemap="" />
</map>
<br />

Number of links in this document:
<script type="text/javascript">
document.write(document.links.length)
</script>

</body>
</html>