Junior JavaScript

What is the use of the alt attribute in images?

The alt attribute provides alternative text when an image fails to load and is read by

screen readers.

Example:

Follow me on LinkedIn:

<img src="team.jpg" alt="Our development team">

Key Takeaway:

Always include meaningful alt text — it’s good for accessibility and SEO.

More from JavaScript Tutorial

All questions for this course