rspec/rules/S6844/html/rule.adoc
github-actions[bot] 3927b70e8d
Add html to rule S6844 (#3665)
Co-authored-by: ericmorand-sonarsource <ericmorand-sonarsource@users.noreply.github.com>
Co-authored-by: Ilia Kebets <104737176+ilia-kebets-sonarsource@users.noreply.github.com>
2024-02-22 14:20:39 +01:00

23 lines
497 B
Plaintext

include::../common/rule.adoc[tag=header]
=== Code examples
==== Noncompliant code example
[source,html,diff-id=1,diff-type=noncompliant]
----
<a href="javascript:void(0)" onClick="foo">Perform action</a>
<a href="#" onClick="foo">Perform action</a>
<a onClick="foo">Perform action</a>
----
==== Compliant solution
[source,html,diff-id=1,diff-type=compliant]
----
<button onClick="foo">Perform action</button>
<a href="#section" onClick="foo" />
----
include::../common/rule.adoc[tag=footer]