WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Using <LI> elements as clickable, focusable objects in menus

for

From: Swift, Daniel P.
Date: Jan 6, 2017 1:58PM


Jeff:

Do you have an example? You have me wondering if I've been doing the wrong thing -- I've never used the list item itself as clickable but instead placed the 'a' tag as a child of the list items. When sub-menus are needed, I've used nested lists (code to demonstrate nesting only):

<ul>
<li><a href="something">parent</a>
<ul>
<li><a href="something">child</a></li>
<li><a href="something">child</a></li>
</ul>
</li>
<li><a href="something">parent</a>
<ul>
<li><a href="something">child</a></li>
<li><a href="something">child</a></li>
</ul>
</li>
</ul>
Thanks!
Dan