dropdownToggle.addEventListener('click', function (event) {
event.preventDefault();
const isExpanded = dropdownMenu.style.display === 'block';
dropdownMenu.style.display = isExpanded ? 'none' : 'block';
dropdownToggle.setAttribute('aria-expanded', !isExpanded);
});
Adding animations can make the dropdown menu more visually appealing. We can use CSS transitions to achieve a smooth fade-in and fade-out effect.