aria-expanded attribute in Bootstrap's collapsible components?aria-expanded attribute in collapsible elements like accordions and dropdowns. What does this attribute do?The aria-expanded attribute tells assistive technologies if a collapsible element is expanded (true) or collapsed (false), helping users understand the current state.
<div class="modal" tabindex="-1" role="dialog" aria-labelledby="modalTitle"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="modalTitle">Modal title</h5> </div> ... </div> </div> </div>
The aria-labelledby attribute references the ID of the element that provides the accessible name for the modal, usually the modal's title.
aria-haspopup="true" and aria-expanded="false"?<button aria-haspopup="true" aria-expanded="false">Menu</button>What does a screen reader say when focusing on this button?
aria-haspopup and aria-expanded communicate.aria-haspopup="true" tells assistive tech that the button opens a menu. aria-expanded="false" means the menu is currently hidden.
aria-disabled="true"?aria-disabled="true"?The correct CSS attribute selector uses square brackets and quotes around the value: [aria-disabled="true"].
<a> link to communicate this state to assistive technologies?<nav class="navbar"> <ul class="navbar-nav"> <li class="nav-item"> <a class="nav-link active" href="#" aria-current="page">Home</a> </li> <li class="nav-item"> <a class="nav-link" href="#">About</a> </li> </ul> </nav>
aria-current="page" tells assistive technologies that this link represents the current page, improving navigation clarity.
