The anchor element's true capability is unlocked solely through its attributes. They dictate everything from the routing coordinates to stringent cross-site security constraints. Without attributes, an anchor tag is merely inert text.
1The href & target Properties
The href (Hypertext REFerence) attribute is strictly mandatory; it defines the absolute or relative destination coordinate for the browser engine.
However, routing requires context control. By default, a link replaces the currently active document. When directing users to an external site or a secondary reference document, this creates friction. The target="_blank" attribute overrides this default behavior. When clicked, it commands the browser to spin up an entirely fresh tab process, allowing the user to explore the new destination while keeping your primary application state completely intact and running in the background.
2Securing External Vectors
Spawning a new tab via target="_blank" introduces a critical security vector. The newly opened tab implicitly inherits a reference to your original tab via the window.opener JavaScript object. A malicious external site can use this object to hijack your original tab and redirect it to a phishing page (an exploit known as 'tabnabbing').
To permanently seal this vulnerability, industry standards mandate pairing target="_blank" with the rel="noopener noreferrer" attribute. The rel (relationship) attribute defines how the current document relates to the linked document. noopener forcefully severs the window.opener connection, completely isolating the new tab's execution environment from your application.
3Asset Distribution & Tooltips
Anchors can distribute data directly to the user's local hardware. By appending the download attribute, you forcefully bypass the browser's standard navigation and PDF-rendering engines. Instead, it triggers an immediate OS-level 'Save As' dialog box. Supplying a string (e.g., download="invoice.pdf") forces the OS to rename the file natively as it saves to disk.
Additionally, because explicit text like 'Click Here' provides zero accessibility context, you should leverage the title attribute. When applied, title commands the OS to generate a native hover tooltip, exposing the destination's intent to the user before they commit to clicking.
