I have a Confirmation screen where previously-entered Form input
fields are shown as static DIVs.
The HTML is below. The DIVs, though static, are focusable with TAB, allowing the user to hit them with the keyboard.
<div>
<label className="itemText"> <!-- Does this need a FOR ID? -->
First Name
</label>
<div id="divFirstName" tabIndex={0}>
{firstName}
</div>
</div>
In this case, is it necessary (or possible) to provide label for=..
or aria-label
to associate displayed <div>
values with <label>
s for 508 compliance, similar to what would be done for actual input
controls? What should be done in this case?
2
Answers
I went with
role="region"
andaria-label="label"
:LABEL TAG – W3SCHOOLS
W3 says the "for" – attribute is only valid for FORM-Elements.
A workaround would be to just use FORM-Elements.
Or use the "role" – attribute:
Accessibility Role, Name & Value
I think this might do the trick.