Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML input alt attribute

HTML alt property

HTML input Tag Reference HTML tag

Example

An HTML form with an image submit button:

First name:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the alt property.


Definition and Usage

The alt attribute provides alternative text for when the user cannot view the image for some reason (such as a slow connection, an error in the src attribute, images disabled in the browser, or the user using a screen reader).

**Note:** The alt attribute can only be used with the .


Differences between HTML 4.01 and HTML5

none.


Syntax

Attribute values

Value Description
text Specifies alternative text for an image.

HTML input Tag Reference HTML tag