I need to update my facet checkboxes inside an <asp:CheckBoxList>
to have the aria-labelledby
attribute to be more accessible to users. However, I can’t find a way to target the checkbox portion directly.
If I add them like this in the controller:
//checkboxListItem is the object representing the checkbox/label collection
checkboxListItem.Attributes.Add("aria-labelledby", ${uniqueLabelOfTheCheckBox.ID}_{indexOfFacet});
checkBoxList.Items.Add(checkboxListItem); //adds the object to the ASP checkboxList
Then the markup will wrap the aria-labelledby
in a <span>
tag, which is incorrect. How and where can I add the ARIA label to the checkbox itself?