alt property
The HTMLImageElement property alt
provides fallback (alternate)
text to display when the image specified by the img
element is not
loaded.
This may be the case because of an error, because the user has disabled the loading of images, or because the image hasn't finished loading yet.
Perhaps the most important reason to use the alt
property is to support
accessibility,
as the alt
text may be used by screen readers and other assistive
technologies to help people with a disability make full use of your
content.
It will be read aloud or sent to a braille output device, for example, to
support blind or visually impaired users.
Think of it like this: When choosing
alt
strings for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image on the page.
The alternate text is displayed in the space the image would occupy and should be able to take the place of the image without altering the meaning of the page.
Implementation
external String get alt;
Implementation
external set alt(String value);