Free scan

Fix "ARIA attribute not allowed for this role" in HTML

Why it's a problem

Each role accepts only a set of attributes. aria-checked on a link or aria-pressed on a heading makes no sense: depending on the screen reader, it is ignored or yields an inconsistent announcement.

How to fix it — HTML

Remove the attribute, or change the role to the one that truly matches the widget's behaviour. If the element toggles a state, it is probably a <button> with aria-pressed, not a link.

Avoid
<a href="#" aria-pressed="true">Mode sombre</a>
Correct
<!-- Un état qui bascule : c'est un bouton -->
<button type="button" aria-pressed="true">Mode sombre</button>

RGAA criterion 7.1 — Scripts

Chaque script est-il, si nécessaire, compatible avec les technologies d’assistance ?

How to check: official tests (in French)

  1. Test 7.1.1

    Chaque script qui génère ou contrôle un composant d’interface vérifie-t-il, si nécessaire, une de ces conditions ?

    Le nom, le rôle, la valeur, le paramétrage et les changements d’états sont accessibles aux technologies d’assistance via une API d’accessibilité ;

    Un composant d’interface accessible permettant d’accéder aux mêmes fonctionnalités est présent dans la page ;

    Une alternative accessible permet d’accéder aux mêmes fonctionnalités.

  2. Test 7.1.2

    Chaque script qui génère ou contrôle un composant d’interface respecte-t-il une de ces conditions ?

    Le composant d’interface est correctement restitué par les technologies d’assistance ;

    Une alternative accessible permet d’accéder aux mêmes fonctionnalités.

  3. Test 7.1.3

    Chaque script qui génère ou contrôle un composant d’interface vérifie-t-il ces conditions (hors cas particuliers) ?

    Le composant possède un nom pertinent ;

    Le nom accessible du composant contient au moins l’intitulé visible ;

    Le composant possède un rôle pertinent.

Full page for criterion 7.1 · 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 — Scripts