Using the aria-required attribute
aria-required attribute is used to indicate that user input is required on an element before a form can be submitted. This attribute can be used with any typical HTML form element; it is not limited to elements that have an ARIA
Note: HTML also specifies the
required attribute which is supported well in user agents. Use
aria-required for backwards compatibility only.
Screen readers should announce the field as required.
Note that this attribute will not automatically change the presentation of the field.
Note: Opinions may differ on how assistive technology should handle this technique. The information provided above is one of those opinions and therefore not normative.
Example 1: A simple form
<form action="post"> <label for="firstName">First name:</label> <input id="firstName" type="text" aria-required="true" /> <br/> <label for="lastName">Last name:</label> <input id="lastName" type="text" aria-required="true" /> <br/> <label for="streetAddress">Street address:</label> <input id="streetAddress" type="text" /> </form>
WAI-ARIA Authoring Practices: Accordion Example (includes the use of the
TBD: Add support information for common UA and AT product combinations