Describe the purpose of using alt attribute in <img> tag in HTML Last Updated : 07 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The <img> alt attribute is used to specify the alternate text for an image. It is useful when the image is not displayed. It is used to give alternative information for an image. It is also very much helpful in the Google ranking of your page. In this article, we will discuss the alt attribute in the <img> tag. Syntax: <img alt="text"> Attribute Values: It contains single value text which specifies the alternative text for an image. Example: In this example, we will use the alt attribute of the img tag. HTML <!DOCTYPE html> <html> <head> <title> HTML img alt Attribute </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML img alt Attribute</h2> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png" alt="GeeksforGeeks logo"> </body> </html> Output: Comment More infoAdvertise with us Next Article Describe the purpose of using alt attribute in <img> tag in HTML S sravankumar_171fa07058 Follow Improve Article Tags : HTML HTML-Tags HTML-Questions Similar Reads What is the purpose of "role" attribute in HTML? The main purpose of the role attribute is to bolster ARIA i.e. Accessible Rich Internet Applications which helps in providing richness and quality from a semantic perspective. Moreover, role attribute makes a website more facilitative, and using this attribute is considered a good practice. Generall 1 min read How to use image height and width attribute in HTML Page ? HTML stands for HyperText Markup Language. Hypertext defines the link between the online pages. It is used to define the text document within tag which defines the structure of websites. This language is used to annotate text in order that a machine can know it and manipulate text accordingly. Most 3 min read Which Inline Attribute Specifies the Styling of Elements in HTML? An inline attribute in HTML refers to the style attribute, which allows you to apply CSS directly to a specific element. This provides quick, element-specific styling without affecting other elements or requiring external stylesheets. It is defined directly within the HTML tag.What is the style Attr 2 min read How to retrieve attribute of an HTML tag using jQuery ? In this article, we will learn how do you retrieve attributes of an HTML tag using jQuery. We can use JQuery to make this done in a few lines of code. Here we are going to build an image zooming system where will see how can an attribute of the HTML tag can be retrieved and changed. Using the attr() 2 min read HTML | <input> alt Attribute 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. Syntax: <input alt="text"> Attribute Values: It contains single value text 1 min read Like