<input type="image"> alt Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Description

The alt attribute provides alternative information for user if user cannot view the image.

For <input> elements, the alt attribute can only be used with <input type="image">.

To create a tooltip for an image, use the title attribute!

Attribute Values

Value Description
text Specifies the alternate text for the area, if the image cannot be displayed

An HTML form with an image that represents the submit button:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
  First name: <input type="text" name="fname"><br>
  <input type="image" src="submit.gif" alt="Submit" width="48" height="48">
</form><!--from w  ww . j  a  v a  2s. com-->

</body>
</html>

Related Tutorials