Skip to content
Related Articles

Related Articles

HTML | <input> alt Attribute

View Discussion
Improve Article
Save Article
  • Last Updated : 12 Aug, 2022

The HTML <input> alt Attribute is used to specify the alternative text for an image when the image attribute is not displayed. It gives alternative information for the user when the image is not loaded to display. 


<input alt="text">

Attribute Values: It contains single value text which is used to specify the alternative text for input if the image is not displaying. 



<!DOCTYPE html>
        HTML Input alt Attribute
<body style="text-align:center;">
    <h1 style="color:green;">
    <h2>HTML Input alt Attribute</h2>
    <input id="myImage"



Supported Browsers:

  • Google Chrome 1 and above
  • Firefox 1 and above
  • Internet Explorer 5.5 and above
  • Edge 12 and above
  • Opera 12.1 and above
  • Apple Safari 1 and above
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!