7.4. Add required or aria-required="true" to mandatory fields

Mandatory fields should have a required or aria-required="true" attribute.

Note

When using these attributes, the <label> should include a distinctive indication.

<label for="email">Your email *</label>
<input type="email" id="email" name="email" required />
<input type="checkbox" id="conditions" aria-required="true" />
<label for="conditions">I accept the conditions of sale (required)</label>

Comments

Add a comment

Required fields are marked *.

Back to top