Properties


ALT Attribute | alt Property

Sets or retrieves a text alternative to the graphic.

Syntax

HTML<ELEMENT ALT = sTxt... >
Scripting[ sTxt = ] object.alt

Possible Values

sTxtString that specifies or receives the text to display as an alternative to the graphic.

The property is read/write. The property has no default value.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are not supported in IE8 mode. For more information, see About Dynamic Properties.

Remarks

The text is used to replace the graphic for text-only browsers and to display in the window before the graphic has loaded. The text also acts as a ToolTip if the title is not set when the user hovers the mouse over the graphic.

Alternate text should be provided whenever the graphic is not rendered. Alternate text is mandatory for Level 0 documents.

In Microsoft Internet Explorer 6, This property now applies to the object object.

Example

This example uses the ALT attribute to indicate that the icon displayed denotes a read/write property.

<IMG SRC="http://example.microsoft.com/rw.gif" ALT="Read/Write Property">

Standards Information

This property is defined in HTML 3.2 World Wide Web link and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

OBJECT, APPLET, AREA, INPUT, INPUT type=image, IMG, HTMLAreaElement Constructor, HTMLImageElement Constructor, HTMLInputElement Constructor, HTMLObjectElement Constructor
Tags :


Community Content

yecril
object/@alt is not shown as a tooltip

Internet Explorer does not show a tooltip for an OBJECT without the TITLE attribute.

Tags : contentbug

Page view tracker