Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is role="listbox" used when creating carousel?

Just a simple question

When I tried to create a carousel, I noticed many sample codes are:

<div class="carousel-inner" role="listbox">

In the above code, what does role="listbox" do? Please give me an insight.

like image 884
JustStartedStudying Avatar asked Sep 16 '16 03:09

JustStartedStudying


1 Answers

role="listbox" is used for accessibility purposes. It identifies to a screen-reader or other assistive technology device that this is an element that allows a user to choose one or more options, such as images in a carousel.

You should also add role="option" to each slide.

see here for more information: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_listbox_role

like image 191
Nate K Avatar answered Sep 22 '22 07:09

Nate K