![github-actions[bot]](/assets/img/avatar_default.png)
* Add html to rule S6793 * Share description with HTML * Fix after review --------- Co-authored-by: yassin-kammoun-sonarsource <yassin-kammoun-sonarsource@users.noreply.github.com> Co-authored-by: yassin-kammoun-sonarsource <yassin.kammoun@sonarsource.com>
32 lines
925 B
Plaintext
32 lines
925 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../../../shared_content/jsts/aria-intro-1.adoc[]
|
|
|
|
This rule checks that the values of ARIA attributes "aria-*" in DOM elements are valid.
|
|
|
|
== How to fix
|
|
|
|
Check that each element with a defined ARIA attribute has a valid value.
|
|
|
|
[source,html,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
<span aria-hidden="ok">foo</span>
|
|
----
|
|
|
|
To fix the code use a valid value for the aria-* attribute.
|
|
|
|
[source,html,diff-id=1,diff-type=compliant]
|
|
----
|
|
<span aria-hidden="true">foo</span>
|
|
----
|
|
|
|
== Resources
|
|
=== Documentation
|
|
|
|
* MDN web docs - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques[Using ARIA: Roles, states, and properties]
|
|
* MDN web docs - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes[ARIA states and properties (Reference)]
|
|
|
|
=== Standards
|
|
|
|
* W3C - https://www.w3.org/TR/wai-aria-1.2/[Accessible Rich Internet Applications (WAI-ARIA) 1.2]
|