# How to show the number of links in a document with JavaScript?

JavascriptWeb DevelopmentFront End Scripts

To get the number of links in JavaScript, use the links property with length property.

## Example

You can try to run the following code to display the number of links in a document −

Live Demo

<!DOCTYPE html>
<html>
<body>
<a href="https://www.tutorialspoint.com/php">PHP</a>
<br>
<a href="https://www.tutorialspoint.com/java/">Java</a>
<br>
<a href="https://www.tutorialspoint.com/html5/">HTML</a>
<br>
<a href="https://www.tutorialspoint.com/css/">CSS</a>
<script>
</html>