Question:

What is the significance of the alt attribute in the <img> tag? Provide one scenario where it is useful.

Show Hint

What appears on screen when an image cannot load?
Updated On: Nov 3, 2026
Show Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Understanding the Question:
We must say why the alt attribute is important and give one real situation where it helps.

Step 2: Significance of alt:
The alt (alternate text) attribute gives a short text description of the image. If the image cannot be displayed, the browser shows this text in its place. So the user still understands what the image stands for.

Step 3: One scenario:
When the internet is slow or the image file is missing, the picture does not load. The alt text such as "Rose" is shown instead. Screen readers also read the alt text for visually impaired users.

Step 4: Example:
<img src="flower.jpg" alt="Rose">


Final Answer:
The alt attribute gives text for an image and is shown when the image does not load. \[ \boxed{\text{alt = alternate text shown if the image fails to load}} \]
Was this answer helpful?
0
0

Top CBSE X Questions

View More Questions