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.
<a href="#" aria-pressed="true">Mode sombre</a><!-- Un état qui bascule : c'est un bouton -->
<button type="button" aria-pressed="true">Mode sombre</button>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