Skip to main content
Beta: Front-End Checklist is currently in beta. Some issues are still being fixed. Thanks for your patience.

Provide alt text for image buttons

Input elements of type='image' must have a descriptive alt attribute.

Utilities
Quick take
Typical fix time 5 min
  • Add an `alt` attribute to `<input type='image'>`
  • Describe the action of the button, not just the image
  • Ensures the button's purpose is clear to assistive technology
Why it matters: Without alt text, screen readers may read the file name of the image, leaving users unable to determine the function of the button.

Rule Details

When an image is used as a form button, it must have alternative text that describes the action the button performs. Both WCAG 1.1.1 (opens in new tab) and the <input type="image"> reference (opens in new tab) treat this as an accessible-name requirement, not a decorative-image exception.

Code Examples

Correct Implementation

<input type="image" src="search-icon.png" alt="Search">
 
<input type="image" src="submit-btn.png" alt="Submit Registration">

Incorrect Implementation

<!-- No alt text -->
<input type="image" src="go.png">
 
<!-- Describing the icon instead of the action -->
<input type="image" src="magnifying-glass.png" alt="Magnifying glass">

Why It Matters

  • Functional Clarity: The alt text for a button should describe the action (e.g., "Search") rather than the visuals (e.g., "Magnifying glass").
  • Accessibility: Users of screen readers need to know what will happen when they interact with the element.
  • Fallbacks: If the image fails to load, the alt text is displayed, allowing the user to still use the form.

Best Practices

Be Action-Oriented: Use verbs like "Search", "Login", "Sign Up".

Keep it Short: Usually one or two words is sufficient for a button.

Don't leave it empty: Unlike decorative images, an image button must have alt text because it is a functional element.

Exceptions

  • Logos, purely decorative text treatments, and screenshots used as documentation can be valid exceptions when their accessible alternative is still provided appropriately.
  • An image or media rule should not force redundant alt text, captions, or transcripts when another nearby mechanism already provides the equivalent information clearly.
  • If the media asset fails more than one rule, prioritize the issue that most directly blocks understanding for assistive technology users.

Verification

Automated Checks

  • Inspect the browser accessibility tree or accessibility pane for the relevant element, role, or accessible name.
  • Run an automated accessibility checker such as axe or Lighthouse where applicable.

Manual Checks

  • Test the affected UI with keyboard-only navigation and confirm the rule holds in the rendered experience.
  • Re-test one representative user flow with a screen reader if this rule affects a key interaction.

Use with AI

Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.

Check

Verify implementation

Verify that all <input type='image'> elements have a non-empty 'alt' attribute.

Fix

Auto-fix issues

Add an 'alt' attribute to the <input type='image'> that describes the action performed when the button is clicked (e.g., 'Search', 'Submit').

Explain

Learn more

Explain why image buttons require alternative text to communicate their function to users who cannot see the image.

Review

Code review

Review the rendered markup and interactive states that affect Provide alt text for image buttons. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.

Sources

References used to support the guidance in this rule.

Further Reading

Tools and supplementary material for exploring the topic in more depth.

axe DevTools
deque.comTool

Rules that often go hand-in-hand with this one.

Provide accessible names for select elements

All `<select>` elements must have an associated label or an accessible name to be correctly identified by screen readers.

Accessibility
Associate labels with form controls

Form inputs must have programmatically associated labels.

Accessibility
Use a single label for each form field

Form fields should have exactly one associated <label> element for maximum clarity.

Accessibility
Provide accessible names for ARIA command elements

Checks that command elements like buttons and links have accessible names for screen reader support.

Accessibility

Was this rule helpful?

Your feedback helps improve rule quality. This stays internal for now.

Loading feedback...
0 / 385