HTML Input alt Attribute

Definition and Usage

The alt attribute specify a short description of the image when using input type="image"
The alt attribute should be a short description of the image
This attribute is used when the user for some reason cannot see the image. This could be because of a slow connection, an error in the image URL, or the user could be using a text-only or non-visual browsers.
This attribute is only used if the type attribute of the input element is set to "image".


<input alt="text" />

Syntax Example

<input alt="button" />

Attribute Values

Value Description
text A short description of the image.Note: Even though this attribute is not specified as required, it should always be used when the input type is "image". Not using the alt attribute will cause problems for text-only browsers or non-visual browsers.

Browser Support

The attribute is supported in all major browsers.


<form action="">
<input type="image" src="input_image.gif" alt="button" />
HTML Input alt Attribute Reviewed by 1000sourcecodes on 04:10 Rating: 5
Powered by Blogger.