input-image-alt-present
<input type="image"> must have an alt attribute
Checks that <input type="image"> elements provide an alt attribute to support a text alternative mechanism.
Applies to. Applies to <input type="image"> elements included in the accessibility tree.
Expectation. Each applicable <input type="image"> element has a non-empty accessible name from aria-labelledby, aria-label, alt or title. An empty name fails, whether alt is missing or empty (alt=""). An author-supplied name that equals a browser default for an image button ("Submit", "Submit Query") is not an empty name: it may describe the button, so it is reported as cantTell for a person to judge.
Examples
<input type="image" src="search.png" alt="Search">
A non-empty alt names the image button.
<input type="image" src="search.png">
No alt attribute.
How to check
When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.
default_name
- Find the image button the report names and read the name the report gives ("Submit" or "Submit Query").
- Look at its image and work out what the button does, for example by what happens when it is pressed.
- Decide whether the name says what the button does.
Pass. The name says what the button does, as "Submit" does on a button that sends a form.
Fail. The name does not say what the button does (such as "Submit Query" on a search button), which fails WCAG 1.1.1.