li with ancestor role=menu or menubar has invalid role
Web Standard
Description
An li element that is a descendant of a role=menu element or role=menubar element must not have any role value other than group, menuitem, menuitemcheckbox, menuitemradio, or separator.
Help
Without a role attribute the implicit role is listitem, which is not allowed in an ARIA menu, so an explicit role attribute is needed to voice the control correctly in a screen reader.
Applicable standards
- ARIA
- WCAG 2.0 (Success Criteria: 4.1.2 level A)
- WCAG 2.1 (Success Criteria: 4.1.2 level A)
- WCAG 2.2 (Success Criteria: 4.1.2 level A)
- Section 508 (2017) (Success Criteria: 4.1.2 level A)
- Section 508 (2017) (Success Criteria: 4.1.2 level A)
- HTML5
Note: Section 508 Refresh (2017) checkpoints are equivalent to WCAG 2.0 level A and level AA checkpoints. EN 301 549 checkpoints are equivalent to WCAG 2.1 level A and level AA checkpoints.
Change history
- 6.59 Dec 2025 Added to W3 validator for ARIA 1.3.
This page describes a web site issue detected in HTML documents by SortSite Desktop and OnDemand Suite.
Rule ID: W3cHtml5AssertNestedMenuLi