When an image is being used as an
providing alternative text helps screen reader users understand the purpose of the button.
Lighthouse reports when any
<input type="image"> elements do not have
How to fix this problem
To fix this problem,
alt attributes for every
<input type="image"> element.
Decribe the action that occurs when the user clicks on the button
(see also Include text alternatives for images and objects):
<input type="image" alt="Sign in"
Even if the image contains only text, provide alternate text. Screen readers can't translate images of words into output. Learn more in Image buttons must have alternate text.
Tips for writing effective
- As previously mentioned, describe the action that occurs when the user clicks on the button.
alttext should give the intent, purpose, and meaning of the image.
- Blind users should get as much information from alt text as a sighted user gets from the image.
- Avoid non-specific words like "chart", "image", or "diagram".
Learn more in WebAIM's guide to Alternative Text.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.