document.links in a web page

Here is the syntax to get numbr of links in a webpage.
document.write(document.links.length);
Here is an example

<script type="text/javascript">
document.write(document.links.length);
</script>
The output is here


docment.links[] is an array so we can display all its elements like this.
for (i=0;i<document.links.length;i++)
{
document.write(document.links[i] + "<br >");
}
Output is here




plus2net.com




Post your comments , suggestion , error , requirements etc here .




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2020 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer