DEV Community

Discussion on: Accessibility for the web - introduction to ARIA

Collapse
 
zwiastunsw profile image
Stefan Wajda


<ul role="navigation">

This is a very bad example. When you add role="navigation" to <ul>, you change the default role of <ul>.
This example should look like this:
<div role="navigation">
<ul>
<li>About</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
<div>

Collapse
 
arikaturika profile image
Arika O • Edited

Are you referring to the rule of ARIA usages which says we shouldn't change the role of native elements? I modified the code, thx, good observation.

Collapse
 
zwiastunsw profile image
Stefan Wajda • Edited

Not only that! When you change the role of the <ul> element, the screenreader will not announce that this is a list of items, will not announce that it has 3 items :)