WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Roles for nest lists


From: Greg Gamble
Date: Dec 11, 2015 11:54AM

OK makes sense .... but if the roles of list and listitem are being used, shouldn't they be in a marked up list in the first place?


-----Original Message-----
From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf Of Léonie Watson
Sent: Friday, December 11, 2015 10:42 AM
To: 'WebAIM Discussion List'
Subject: Re: [WebAIM] Roles for nest lists

> From: WebAIM-Forum On Behalf Of Greg Gamble
> Sent: 11 December 2015 18:36
> I have a nested list ... is it given the same roles as the parent?

It is, but you don't need to use the roles if you're using the HTML ul/li elements.



<div role="list">
<span role="listitem">Fruit>
<div role="list">
<span role="listitem">Apples</span>
<span role="listitem">Bananas</span>
<span role="listitem">Vegetables</span>

Note: The use of div and span in the second example is arbitrary. You could use all spans or all divs for example.


@LeonieWatson tink.uk Carpe diem