Missing anchor
Silktide tests links that point to a specific part of the same page - such as
#content - and reports the ones whose target does not exist. Clicking such a
link silently does nothing, leaving the user where they were.
<!-- Broken: nothing on the page has id="content" -->
<a href="#content">Skip to content</a>
<!-- Fixed: the target exists -->
<a href="#content">Skip to content</a>
...
<main id="content">...</main>
Why this matters
Links to missing anchors fail silently: there is no error page, the page just does not move. For sighted users this is confusing; for and keyboard users it is worse, because these in-page links are often the very mechanisms - like "skip to content" or a table of contents - that make a long page navigable. A broken anchor quietly removes that shortcut.
How to fix it
- Add the missing target: give the intended element an
idmatching the link's fragment, for example<section id="pricing">for a link to#pricing. - Or correct the link if the target exists under a different
id- fragments are case-sensitive, so#Pricingdoes not matchid="pricing". - If the link only exists to trigger ,
still point its fragment at the real element's
id. The link then keeps its meaning without JavaScript; you may need to prevent the default scroll in your script.
<!-- The fragment matches the element the script reveals -->
<a href="#details" onclick="toggle('details')">Show details</a>
<div id="details">...</div>
How Silktide tests this
- Find every link on the page whose destination includes a fragment (the part
after
#). - Keep only links that point at the current page - either purely
#fragmentlinks or full URLs to the same page. Links to anchors on other pages are not tested by this check. - Look for an element whose
idmatches the fragment, or a legacy<a name="...">anchor with a matching name. - Flag the link if neither exists.