# How to search the value of the href attribute of a link in JavaScript?

HTMLJavascriptProgramming Scripts

To get the value of the href attribute of a link in JavaScript, use the href property. It gives you the URL of the linked document in JavaScript.

## Example

You can try to run the following code to get the value of the href attribute of a link.

Live Demo

<!DOCTYPE html>
<html>
<body>
<p><a id="anchorid" href="https://www.qries.com/">Qries</a></p>
<script>
</html>