I have the following code (from here):
<div role="menubar">
<ul role="menu" aria-label="functions" id="appmenu">
<li role="menuitem" aria-haspopup="true" tabindex="0" aria-expanded="false">
File
<ul role="menu">
<li role="menuitem" tabindex="-1">New</li>
<li role="menuitem" tabindex="-1">Open</li>
<li role="menuitem" tabindex="-1">Print</li>
</ul>
</li>
<li role="menuitem" aria-haspopup="true" tabindex="-1" aria-expanded="false">
Edit
<ul role="menu">
<li role="menuitem" tabindex="-1">Undo</li>
<li role="menuitem" tabindex="-1">Redo</li>
<li role="menuitem" tabindex="-1">Cut</li>
<li role="menuitem" tabindex="-1">Copy</li>
<li role="menuitem" tabindex="-1">Paste</li>
</ul>
</li>
<li role="menuitem" aria-haspopup="true" tabindex="-1" aria-expanded="false">
Format
<ul role="menu">
<li role="menuitem" tabindex="-1">Font</li>
<li role="menuitem" tabindex="-1">Text</li>
</ul>
</li>
<li role="menuitem" aria-haspopup="true" tabindex="-1" aria-expanded="false">
View
<ul role="menu">
<li role="menuitem" tabindex="-1">100%</li>
<li role="menuitem" tabindex="-1">Zoom In</li>
<li role="menuitem" tabindex="-1">Zoom Out</li>
</ul>
</li>
<li role="menuitem" tabindex="-1" aria-expanded="false">Help</li>
</ul>
</div>
However when I try to validate (via the W3C validator) that HTML piece it gives the error:
Attribute
aria-expanded
not allowed on elementli
at this point.
As this is an official W3C example I’m a little bit confused as their own example didn’t validate with their own validator. What’s wrong here?