Name

ALT — NN all IE all HTML all

Synopsis

ALT=”textMessage"

Required

In a world littered with graphical browsers, it is often hard to remember that not everyone can, or chooses to, download images. Aside from those using VT100 terminals with browsers such as Lynx, pocket computers often offer better performance when images don’t have to be downloaded and rendered. To replace the image in such a browser, the text assigned to the ALT attribute is displayed where the IMG element appears on the page. The ALT attribute should contain a brief description of what the image is. The HTML recommendation calls the ALT attribute a requirement for the IMG element, but in practice, graphical browsers can get by without it. Still, some browsers display the ALT text initially as the image downloads from the server, providing a temporary alternate display. Be aware that the size of the image area on the page may limit the amount of text you can use for ALT. Make sure the description is readable.

Example

<IMG SRC="navbar.gif" USEMAP="#nav" ALT="Navigation Bar" WIDTH=400 HEIGHT=50>

Value

Any quoted string of characters.

Default

None.

Object Model Reference

IE

[window.]document.imageName.alt

[window.]document.images[i].alt

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.