Image alt property
Image Object
Definition and Usage
The alt property sets or returns the value of the alt attribute of an image.
The alt attribute specifies the replacement text displayed when the image cannot be displayed properly (slow network, broken image link).
Note: Internet Explorer displays tooltip text after the mouse moves over the img element, which is non-standard according to the HTML specification. All other browsers display the alt text only when the image cannot be shown.
Tip: If you want to create an image toolbar, use the title attribute.
Syntax
imageObject.alt=
text
Browser support





All major browsers support the alt property.
Example
Example
Return the replacement text of the image:
The alt attribute value is:
Try it »
Image Object