Location: href property - Web APIs | MDN
Value
A string.
Examples
js
// Lets imagine an <a id="myAnchor" href="https://developer.mozilla.org/en-US/Location/href"> element is in the document
const anchor = document.getElementById("myAnchor");
const result = anchor.href; // Returns: 'https://developer.mozilla.org/en-US/Location/href'
Specifications
| Specification |
|---|
| HTML # dom-location-href-dev |