
org.sonar.l10n.web.rules.Web.MouseEventWithoutKeyboardEquivalentCheck.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-web-plugin Show documentation
Show all versions of sonar-web-plugin Show documentation
Enables scanning of HTML, and JSP/JSF files.
Offering the same experience with the mouse and the keyboard allow users to pick their preferred devices.
Additionally, users of assistive technology will also be able to browse the site even if they cannot use the mouse.
Noncompliant Code Example
<a onClick="doSomething();" ...> <!-- Noncompliant - 'onKeyPress' missing -->
<a onMouseover="doSomething();" ...> <!-- Noncompliant - 'onFocus' missing -->
<a onMouseout="doSomething();" ...> <!-- Noncompliant - 'onBlur' missing -->
Compliant Solution
<a onClick="doSomething();" onKeyPress="doSomething();" ...> <!-- Compliant -->
<a onMouseover="doSomething();" onFocus="doSomething();" ...> <!-- Compliant -->
<a onMouseout="doSomething();" onBlur="doSomething();" ...> <!-- Compliant -->
© 2015 - 2025 Weber Informatics LLC | Privacy Policy