HTML img alt Attribute (original) (raw)

Last Updated : 14 Oct, 2024

The alt attribute is used to specify alternative text for an image. This attribute is particularly useful when the image cannot be displayed, either due to a broken link or when users rely on screen readers.

**Syntax

text

**Attribute Values

Example of img alt Attribute

HTML img alt attribute works only when the image link is broken or the image cannot be displayed, so in this example, we are showing the broken image to so the output of the alt attribute.

html `

HTML img alt Attribute

GeeksforGeeks

<h2>HTML img alt Attribute</h2>

<img src="https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png" alt="GeeksforGeeks logo">

`

**Output:

**Supported Browsers:

The browser supported by _HTML alt Attribute are listed below: