Will It Vibe logoWill It Vibe?
A11Y-020Medium severity-8 points

Label references a missing id

Part of Documentation, UX & Accessibility, which counts for 15% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.

What it detects

A <label for="x">/htmlFor="x" whose target id does not exist anywhere in the file is a broken association: the browser cannot connect the label to any control, so clicking the label does not focus anything and a screen reader announces the label and the field as two unrelated pieces of text. This usually means the input's id was renamed or removed and the label was left behind. Fix the id to match, or remove the stale label.

Why it matters

A <label for="x"> whose target id does not exist anywhere in the file is a silently broken association: clicking the label does not focus the field it is meant to describe, and a screen reader announces the label text and the input as two disconnected pieces of content instead of one named field. This almost always happens when an input's id was renamed or removed during a refactor and the label was not updated to match.

How to fix it

Update the label's for (or htmlFor) attribute to match the input's current id, or add the missing id back to the intended input if it was dropped by mistake. Search the file for what the label was originally describing to find the right target rather than guessing.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Documentation, UX & Accessibility checks