Free scan

Fix "ARIA command without a name" in HTML

Why it's a problem

An element carrying a button, link or menuitem role but no text is announced as “button” and nothing else. The icon-only button is the classic case. With 576 occurrences across 49 pages, it is the failure that repeats most within a single page.

How to fix it — HTML

Give the command an accessible name: visible text, an aria-label, or an aria-labelledby pointing at an existing label. The icon's own title is not enough, and a lone icon should carry aria-hidden so it is not announced twice.

Avoid
<div role="button" tabindex="0">
  <svg>…</svg>
</div>
Correct
<button type="button" aria-label="Fermer la fenêtre">
  <svg aria-hidden="true">…</svg>
</button>

<!-- Ou, si un libellé existe déjà dans la page : -->
<h2 id="titre-panneau">Filtres</h2>
<button type="button" aria-labelledby="titre-panneau">
  <svg aria-hidden="true">…</svg>
</button>

RGAA criterion 11.9 — Formulaires

Dans chaque formulaire, l’intitulé de chaque bouton est-il pertinent (hors cas particuliers) ?

How to check: official tests (in French)

  1. Test 11.9.1

    L’intitulé de chaque bouton vérifie-t-il ces conditions (hors cas particuliers) ?

    S’il est présent, le contenu de l’attribut WAI-ARIA aria-label est pertinent ;

    S’il est présent, le passage de texte lié au bouton via un attribut WAI-ARIA aria-labelledby est pertinent ;

    S’il est présent, le contenu de l’attribut value d’une balise <input> de type submit, reset ou button est pertinent ;

    S’il est présent, le contenu de la balise <button> est pertinent ;

    S’il est présent, le contenu de l’attribut alt d’une balise <input> de type image est pertinent ;

    S’il est présent, le contenu de l’attribut title est pertinent.

  2. Test 11.9.2

    Chaque bouton affichant un intitulé visible vérifie-t-il ces conditions (hors cas particuliers) ?

    S’il est présent, le contenu de l’attribut WAI-ARIA aria-label contient au moins l’intitulé visible ;

    S’il est présent, le passage de texte lié au bouton via un attribut WAI-ARIA aria-labelledby contient au moins l’intitulé visible ;

    S’il est présent, le contenu de l’attribut value d’une balise <input> de type submit, reset ou button contient au moins l’intitulé visible ;

    S’il est présent, le contenu de la balise <button> contient au moins l’intitulé visible ;

    S’il est présent, le contenu de l’attribut alt d’une balise <input> de type image contient au moins l’intitulé visible ;

    S’il est présent, le contenu de l’attribut title contient au moins l’intitulé visible.

Full page for criterion 11.9 · Official text: Référentiel général d'amélioration de l'accessibilité (RGAA) 4.1, DINUM, Licence Ouverte 2.0.

Check your site in 30 seconds

Conformly detects this kind of issue across all your pages, continuously, and alerts you on every regression.

Free scan

Other fixes — Formulaires