Why you shouldn't use a div for everything - creating accessible buttons and navigations

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUIAccessibility32 min

About this video

Walks through rebuilding a div-based button and mobile navigation menu with semantic HTML, aria-expanded state and clearer JavaScript, and explains why the original version was inaccessible. Aimed at developers and designers who already write some HTML, CSS and JavaScript.

What you’ll learn

  • Replace div-based buttons with semantic button elements
  • Add aria-expanded state to a disclosure menu with JavaScript
  • Hide and show a navigation list accessibly with CSS and JavaScript