href
The href attribute specifies the URL or destination an anchor or link element points to.
Syntax
href="url" Examples
<a href="/about">About</a>
<a href="https://example.com">External</a>
<a href="#top">Back to top</a>
<a href="tel:+15551234">Call us</a>
Output
Renders four links: a same-site path, an absolute URL, an in-page fragment, and a tel link.
Notes
Accepts absolute, relative, fragment (#id), and scheme URLs (mailto:, tel:). An <a> without href is not a hyperlink and is not focusable.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |