Module anchor

Module anchor 

Source
Expand description

Attribute names for anchor (<a>) elements.

§Purpose

The <a> element creates hyperlinks to other pages, locations within the same page, files, email addresses, or any other URL.

§Common Attributes

  • href: The URL that the hyperlink points to
  • target: Where to display the linked URL (_blank, _self, _parent, _top)
  • rel: Relationship between current and linked document
  • download: Suggests downloading the linked resource
  • referrerpolicy: Controls referrer information sent with requests

§Example

<a href="https://example.com" target="_blank" rel="noopener noreferrer">
  External Link
</a>
<a href="/page" hreflang="en">Internal Link</a>
<a href="document.pdf" download="filename.pdf">Download PDF</a>

§WHATWG Specification

Constants§

DOWNLOAD
The download attribute.
HREF
The href attribute.
HREFLANG
The hreflang attribute.
REFERRERPOLICY
The referrerpolicy attribute.
REL
The rel attribute.
TARGET
The target attribute.
TYPE
The type attribute.