26 lines
529 B
Plaintext
26 lines
529 B
Plaintext
include::../common/why.adoc[]
|
|
|
|
include::../common/how.adoc[]
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,javascript,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
function MyImage() {
|
|
return <img src="sunrise.jpg" alt="image of a sunrise" />; // Noncompliant: "Image, image of a sunrise"
|
|
}
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,javascript,diff-id=1,diff-type=compliant]
|
|
----
|
|
function MyImage() {
|
|
return <img src="sunrise.jpg" alt="a sunrise over a mountain range" />;
|
|
}
|
|
----
|
|
|
|
include::../common/resources.adoc[]
|