HTML DOM links Collection
Complete Document Object Reference
Definition and Usage
The links collection returns a reference to all Area and Link objects in the document.
Syntax
Example
<html>
<body>
<img src="planets.gif"
width="145" height="126"
usemap="#planetmap" />
<map name="planetmap">
<area id="venus" shape="circle"
coords="124,58,8"
alt="Venus"
href="venus.htm" />
</map>
<br />
Number of links in this document:
<script type="text/javascript">
document.write(document.links.length)
</script>
</body>
</html>
|
Try-It-Yourself Demos
Return the number of links in a document
Return the id of the first link (area) in a document
Complete Document Object Reference
|