← Back to homeWCAG

Error messages & WCAG 4.1.3 — what most developers miss

Most developers test error messages visually. If the red border appears and the message shows up, the job's done. But WCAG 4.1.3 asks a different question: does this change reach assistive technology?

What is a status message

A status message is any change in content that isn't triggered by user focus — errors, confirmations, loading states. If it isn't announced, it doesn't exist for screen reader users.

The fix

The fix is not complicated. Adding role="alert" to the error container adds an implicit aria-live="assertive" to the element. Any content injected into it will be read immediately by screen readers.

Comparison between correct and incorrect implementation of aria-invalid and role alert for WCAG 4.1.3

Why most developers miss it

Because it works visually. The red border, the message — all visible. The disconnect only shows up when you turn on a screen reader.

This is why accessibility testing cannot be visual only.