Accessibility · Junior · Question 42 of 75

An icon-only close button has no text. How do you give it a name?

<button>
  <svg aria-hidden="true">...</svg>
</button>
Show the answer

Correct answer: Add aria-label="Close" to the button

Explanation

Without a name, a screen reader only says "button". Visually hidden text inside the button works too, and it's translated by browser tools more reliably.

Further reading

Problem with a question

Accessibility · Junior · question 42

Test yourself

Take the Accessibility · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz