 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to search the value of the href attribute of a link in JavaScript?
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.
<!DOCTYPE html> <html>    <body>       <p><a id="anchorid" href="https://www.qries.com/">Qries</a></p>       <script>          var myLink = document.getElementById("anchorid").href;          document.write("Link: "+myLink);       </script>    </body> </html>Advertisements
 