Get all links on a page : links : Document JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Document » links »

 

Get all links on a page

















<html>
<head>
<title>Get all links on a page</title>

</head>
<body>

<h1>Get all links on a page</h1>

<P>
<a href="http://www.navioo.com/">Example</a><br />
<a href="http://www.navioo.com/">Example</a><br />
<a href="http://www.navioo.com/">Example</a><br />
<a href="http://www.navioo.com/">Example</a><br />
<a href="http://www.navioo.com/">Example</a><br />
<a href="http://www.navioo.com/">Example</a><br />
</p>

<script language="javascript" type="text/javascript">
<!--

var allLinks = document.links;
for (var i=0; i<allLinks.length; i++) {
  document.write(allLinks[i].href+"<BR/>");
}

//-->
</script>

</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Document
» links