HTML accessibility audit and fixes
Review HTML or component code for accessibility problems like missing labels, poor focus handling and ARIA misuse, and get corrected code.
- Published
- Works with
- ChatGPT, Claude and Gemini
- Level
- Intermediate
Many accessibility problems — form fields without labels, clickable divs, missing focus styles, images without alt text — are easy to fix once someone points them out. This HTML accessibility prompt reviews your markup or component code against common WCAG issues, explains who each problem affects and returns corrected code you can drop in.
The prompt
Act as a senior front-end developer who specialises in accessibility. Review this code.
Framework:
What the component does:
Target standard:
Code:
Check for: semantic elements, headings order, labels and instructions for inputs, error messages linked to fields, keyboard access and tab order, visible focus, focus management in modals and menus, ARIA used correctly (and not where native HTML works), alt text, colour contrast risks in the CSS, motion and timing, touch target size, screen reader announcements for dynamic content.
Output:
1. A table: issue, line or element, who it affects, WCAG criterion, severity.
2. The corrected code in full, with comments on each change.
3. Manual tests I should still run (keyboard only, screen reader, zoom to 200%).
Don't claim the code is fully compliant; automated review can't confirm that.
How to use it
- Paste one component at a time with its CSS if contrast or focus is in question.
- Run the manual tests with a keyboard and a screen reader after applying fixes.
- Add the patterns to your component library so new code starts accessible.
Tips
- Use a real
<button>instead of a clickable div; it brings keyboard support for free. - Pair this with an automated checker in CI to catch regressions.
Frequently asked questions
What does this prompt do?
Review HTML or component code for accessibility problems like missing labels, poor focus handling and ARIA misuse, and get corrected code.
Which AI tools does it work with?
It is written for ChatGPT, Claude and Gemini. It also works in other AI tools that accept text prompts, with small changes.
What do I need to fill in?
4 blanks: plain html / react / vue / other; e.g. signup form, modal dialog, navigation menu, product card; e.g. wcag 2.2 aa; paste code. Click each blue blank on the page, type your details and press Copy prompt.
Is this prompt free to use?
Yes. You can copy and use it for personal and commercial work.