A11y Lablearn by doing
0/20

Accessible names · 06

Name icon-only buttons

An icon can be visually clear while leaving a button silent or noisy in the accessibility tree.

What to do

  1. Name the buttons Delete message, Mark as done, and Add message.
  2. Keep the visible controls icon-only.
  3. Hide each decorative SVG from the accessibility tree and focus order.
/index.html
Preview
updating…

Result

Run the checks

Edit the HTML and select “Check solution”. The preview updates automatically.

If you are stuck

Put the action name on the button. The SVG itself does not need to be announced.

Read the exact rule or pattern

Exercise 6 of 20

axe-core

Automated audit