Add aria-expanded to add semantic value and styling

InstructorLindsey Kopacz

Share this video with your friends

Send Tweet

In this lesson, we will be going over the attribute aria-expanded. Instead of using a class like .open we are going to use the aria-expanded attribute to style.

This accomplished double duty because we have semantic value and visual indicators that a button is open and closed.

To test this, I opened up Safari and used CMD + F5 to turn VoiceOver on.