Incomplete Anchor

ID

html.incomplete_anchor

Severity

low

Remediation Complexity

low

Remediation Risk

low

Remediation Effort

low

Resource

Reliability

Language

Html

Tags

accessibility, reliability

Description

Flags an opening <a> element that has neither an href nor an id nor a name attribute.

Rationale

An anchor with no href is not a link, and without an id or name it is not a navigable bookmark target either, so it conveys no semantics to the browser or to assistive technology. Bookmark anchors that carry an id or name are intentional and are not flagged.

<a class="x">Read more</a>     <!-- FLAW — neither link nor bookmark -->

<a href="/page">Read more</a>  <!-- OK — a real link -->
<a id="top"></a>               <!-- OK — a bookmark target -->

Remediation

Give the anchor an href to make it a link, or an id/name to make it a bookmark target. If the element is neither, use a more appropriate element such as <button> or a plain text container.