Aria-invalid for input fields (aria-invalid)
Custom input fields or input fields with novalidate attribute include a valid aria-invalid attribute that corresponds with the state of the field.
Aria-invalid on non-widget element:
In this example, aria-invalid is used on a non-widget element (<p>). The attribute is intended for native form controls (<input>, <textarea>, <select>) or elements with appropriate ARIA widget roles (e.g., textbox, combobox, spinbutton).
Sample paragraph marked aria-invalid="true" — this is not a form control or ARIA widget.