Complete the code to make the button focusable by keyboard.
<button type="button" [1]>Click me</button>
Adding tabindex="0" makes the button reachable by keyboard navigation.
Complete the code to add an accessible label for screen readers.
<button type="button" aria-[1]="Close menu">Ć</button>
The aria-label attribute provides an accessible name for screen readers.
Fix the error in the code to allow keyboard users to open the dropdown menu.
<div class="dropdown"> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle=[1] aria-expanded="false"> Dropdown button </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <li><a class="dropdown-item" href="#">Action</a></li> </ul> </div>
The data-bs-toggle="dropdown" attribute enables Bootstrap's dropdown toggle behavior for keyboard and mouse users.
Fill both blanks to make the dropdown accessible and keyboard navigable.
<div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle=[1] aria-haspopup=[2] aria-expanded="false"> Menu </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <li><a class="dropdown-item" href="#">Item 1</a></li> </ul> </div>
Setting data-bs-toggle="dropdown" activates the dropdown. Adding aria-haspopup="true" informs assistive tech that the button controls a menu.
Fill all three blanks to create a keyboard accessible modal trigger button.
<button type="button" class="btn btn-primary" data-bs-toggle=[1] data-bs-target=[2] aria-[3]="false"> Launch modal </button>
The button uses data-bs-toggle="modal" to open a modal. The data-bs-target="#exampleModal" points to the modal's ID. The aria-expanded="false" indicates the modal is initially closed.
