auditmysitev2.0.2

Missing alternative text on image buttons

images/input-alt-missing

WCAG success criterion
1.1.1 (level A)
Outcome class
Automatic. An automated check that can report a confirmed violation.
Area
Accessibility, Content & Alternatives
Default severity
high
axe-core rule
input-image-alt

Why we flag this

Screen reader users are not told what action the button triggers.

<input type="image"> without an alt attribute.

What the rule checks

Scope. Every rendered <input type="image">.

Expectation. An image button without alt, aria-label or aria-labelledby gets a browser fallback name ("Submit") that says nothing about the action (H36): violation at the input. aria-labelledby pointing at hidden text names it and passes.

Source. WCAG 2.2 SC 1.1.1 Non-text Content (H37, H24, H36, H53, ARIA6, ARIA10, F65, F30); HTML §4.8; accname 1.2; HTML §4.10.5.1.20 image button

Detection: shared; needs dom, computed_style.

Failing example

The check reports a violation here. Corpus case misc_content_checks. The page may contain further findings for other rules.

misc_content_checks.htmlHTML
<!DOCTYPE html>
<html lang="en" xml:lang="de">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3">
    <title>Misc content checks corpus case</title>
    <style>
        .low-contrast-checkbox {
            border: 1px solid #f8f8f8;
            background: #ffffff;
        }
        /* Controls sized to 44px: this case is not about target size. */
        button, input { min-width: 44px; min-height: 44px; }
        .inline-link {
            color: blue;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <main>
        <h1>Image maps, tables, abbreviations, and misc issues</h1>

        <!-- area-alt -->
        <img src="/floorplan.png" usemap="#floor-map" alt="Floor plan">
        <map name="floor-map">
            <area href="/room1" shape="rect" coords="0,0,50,50">
        </map>

        <!-- input-image-alt -->
        <input type="image" src="/submit.png">

        <!-- presentation-semantic-children: dropped in #697 — role="presentation" does not
             strip the semantics of descendants (WAI-ARIA 1.2), so this is no finding -->
        <div role="presentation">
            <button>Semantic button inside a presentation container</button>
        </div>

        <!-- tables/header-missing: data table without any headers -->
        <table>
            <tbody>
                <tr><td>Alice</td><td>90</td></tr>
                <tr><td>Bob</td><td>85</td></tr>
            </tbody>
        </table>

        <!-- redundant-entry: two email fields without reuse/autocomplete -->
        <form>
            <label for="email-a">Email</label>
            <input type="email" id="email-a" name="email_a">
            <label for="email-b">Confirm email</label>
            <input type="email" id="email-b" name="email_b">
        </form>

        <!-- abbreviations -->
        <p><abbr>W3C</abbr> publishes web standards.</p>

        <!-- modern-attribute-misuse: popovertarget references a missing element -->
        <button popovertarget="missing-popover-id">Open</button>

        <!-- non-text-contrast-css: checkbox border barely distinguishable from background -->
        <input type="checkbox" class="low-contrast-checkbox">

        <!-- link-in-text-block: inline link distinguished only by color -->
        <p>Read our <a href="/policy" class="inline-link">privacy policy</a> for details.</p>
    </main>
</body>
</html>

Passing example

The check passes here and reports nothing. Corpus case content_images_ok. The page may contain further findings for other rules.

content_images_ok.htmlHTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Exhibition: maps of the old town</title>
    <style>
        .icon { display: inline-block; width: 16px; height: 16px; background: #446; }
        .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    </style>
    <style>
        nav a, .skip-link, form input, a[href="/print"] { display: inline-block; min-width: 44px; min-height: 44px; }
    </style>
</head>
<body>
    <a class="skip-link" href="#main">Skip to main content</a>
    <header>
        <p>City Library</p>
        <nav aria-label="Main"><a href="/" aria-current="page">Home</a> <a href="/catalogue">Catalogue</a> <a href="/visit">Visit</a></nav>
    </header>
    <main id="main">
        <h1>Exhibition: maps of the old town</h1>
        <img id="poster" src="/poster.jpg" alt="Poster: maps of the old town, 3 May to 30 June" width="200" height="120">
        <img id="divider" src="/divider.png" alt="" width="200" height="4">
        <img id="labelled" src="/map-1850.png" aria-label="Town map of 1850" width="200" height="120">
        <p id="caption-1900">Town map of 1900</p>
        <img id="labelledby" src="/map-1900.png" aria-labelledby="caption-1900" width="200" height="120">
        <img id="titled" src="/seal.png" title="Town seal" width="40" height="40">
        <img id="three-chars" src="/sign.png" alt="Inn" width="40" height="40">
        <img id="presentational" src="/flourish.png" role="presentation" width="40" height="10">
        <img id="hidden-from-at" src="/flourish.png" aria-hidden="true" width="40" height="10">
        <img id="not-rendered" src="/print-only.png" style="display: none">
        <img id="hidden-attr" src="/later.png" hidden>
        <img id="town-map" src="/town.png" usemap="#town-areas" alt="Old town districts" width="200" height="120">
        <map name="town-areas">
            <area id="area-market" href="/districts/market" shape="rect" coords="0,0,100,60" alt="Market district">
            <area id="area-harbour" href="/districts/harbour" shape="rect" coords="100,0,200,60" aria-label="Harbour district">
            <area id="area-decor" shape="rect" coords="0,60,200,120">
        </map>
        <form action="/search">
            <label for="q">Search the collection</label>
            <input id="q" name="q" type="search">
            <input id="search-go" type="image" src="/go.png" alt="Search">
            <span id="reset-label" hidden>Clear search</span>
            <input id="search-clear" type="image" src="/clear.png" aria-labelledby="reset-label">
        </form>
        <object id="catalogue-pdf" data="/catalogue.pdf" type="application/pdf" width="300" height="200">
            <a href="/catalogue.pdf">Download the exhibition catalogue (PDF)</a>
        </object>
        <object id="floor-plan" data="/floor.svg" type="image/svg+xml" title="Floor plan of the exhibition" width="300" height="200"></object>
        <audio id="muted-loop" autoplay muted loop src="/ambience.mp3"></audio>
        <audio id="tour-audio" controls src="/tour.mp3"></audio>
        <span id="warning-icon" role="img" aria-label="Warning" class="icon"></span>
        <span id="decor-icon" role="img" class="icon" aria-hidden="true"></span>
        <a href="/print"><span id="print-icon" role="img" class="icon"></span>Print this page</a>
    </main>
    <footer><p>City Library, 1 Market Square</p></footer>
</body>
</html>

This page is generated from the rule catalogue and the rule contracts; see therule overview for how the outcome classes are derived.