We’ll modify our JavaScript to update the `aria-expanded` attribute when the dropdown is toggled.
dropdownToggle.addEventListener('click', function (event) {
event.preventDefault();
const isExpanded = dropdownMenu.style.display === 'block';
dropdownMenu.style.display = isExpanded ? 'none' : 'block';
dropdownToggle.setAttribute('aria-expanded', !isExpanded);
});