All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S6827.html Maven / Gradle / Ivy

There is a newer version: 10.17.0.28100
Show newest version

Why is this an issue?

Anchors, represented by the a tag in HTML, usually contain a hyperlink that users can click to navigate to different sections of a website or different websites altogether.

However, when anchors do not have content or when the content is hidden from screen readers using the aria-hidden property, it creates a significant accessibility issue. If an anchor’s content is hidden or non-existent, visually impaired users may not be able to understand the purpose of the anchor or navigate the website effectively.

This rule checks that anchors do not use the aria-hidden property and have content provided either between the tags or as aria-label or title property.

How to fix it

Ensure that anchors either have content or an aria-label or title attribute, and they should not use the aria-hidden property.

Code examples

Noncompliant code example

<a aria-hidden>link to my site</a>

Compliant solution

<a>link to my site</a>

Resources

Documentation

Standards





© 2015 - 2024 Weber Informatics LLC | Privacy Policy