Defeating your Foe: the Red Dot is Ours!
To Come...
alt
attribute on img tags is mandatory. However, sometimes images are grouped with a caption already describing them, or are used for decoration only. In these cases alt
text may seem redundant or unnecessary.
In situations when an image is already explained with text content, or does not add meaning to a page, the img
still needs an alt
attribute, but it can be set to an empty string. Here's an example:
<img src="visualDecoration.jpeg" alt="">
Background images usually fall under the 'decorative' label as well. However, they are typically applied with CSS rules, and therefore not part of the markup screen readers process.
Notealt
text, since it helps search engines catalog the content of the image.
alt
attribute to the img
tag and set it to an empty string. (Note that the image src
doesn't link to an actual file - don't worry that there are no swords showing in the display.)
img
tag should have an alt
attribute.
testString: assert(!($('img').attr('alt') == undefined), 'Your img
tag should have an alt
attribute.');
- text: The alt
attribute should be set to an empty string.
testString: assert($('img').attr('alt') == '', 'The alt
attribute should be set to an empty string.');
```
To Come...
To Come...