The aria-describedby attribute connects an interface element to another element containing additional descriptive information. For form fields, that relationship can point to an error message so screen readers and other assistive technologies receive the same guidance as sighted users. section 10.8
Connect a name field to its error
Give the error container an ID, then reference that ID from the input: <input id="name" required aria-describedby="nameError"> and <div id="nameError"><span role="alert">Please let us know who you are</span></div>. Keep the referenced div in the document even when the message is hidden; hide only its contents with CSS so the programmatic connection remains intact. section 10.8
Inspect the complete name-field markup and see how the input’s aria-describedby value matches the error container’s id. section 10.8
