A screen reader reads all elements when the page loads, so it does not pick
up if an element suddenly appears, as often happens with error messages.
Aria-live is an attribute you can add to elements that may change.
aria-live="polite" will make the screen reader announce the
error message when it occurs.