The alt attribute provides a textual alternative to an image.
It is used whenever the actual image cannot be rendered.
Common reasons for that include:
The following code illustrates this rule:
<img src="foo.png" /> <!-- Non-Compliant --> <input type="image" src="foo.png" /> <!-- Non-Compliant --> <img src="foo.png" alt="Some textual description of foo.png" /> <!-- Compliant --> <input type="image" src="foo.png" alt="..." /> <!-- Compliant -->