Will It Vibe logoWill It Vibe?
A11Y-008Low severity-4 points

Anchor styled as a button via href="#" plus a click handler

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

What it detects

An <a href="#"> or <a href="javascript:void(0)"> that also carries a click handler is not a link at all: it goes nowhere, so it is being used purely to get a clickable element, which is what <button> is for. Screen readers announce it as a link (implying navigation) and "#" scrolls the page or pollutes browser history when the handler does not call preventDefault. Use a real <button> instead.

Why it matters

An <a href="#"> or <a href="javascript:void(0)"> with a click handler does not navigate anywhere; it exists purely to be clickable, which is exactly what <button> is designed for. Screen readers announce it as a link, setting an expectation of navigation that never happens, and href="#" without preventDefault also scrolls the page to the top or adds a junk entry to browser history.

How to fix it

Replace the anchor with a <button type="button"> and move the existing click handler onto it unchanged; buttons need no href, no preventDefault dance, and are already keyboard-operable. Reserve <a> for elements that actually navigate to a URL or in-page anchor.

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