Collapse a Submenu on the blur Event to Improve Navigation Accessibility

Share this video with your friends

Send Tweet

In this lesson, we extend off Expand a Menu on a focus Event to Improve Navigation Accessibility to improve the navigation. We use a bit of JavaScript to collapse the submenu on blur. This is important to ensure that if someone cannot use a mouse, they are still able to close the menu.

https://developer.mozilla.org/en-US/docs/Web/API/Element/blur_event