1. Home
  2. Computer Science MCQs
  3. HTML
  4. What is the main purpose of the alt attribute on an element?

Added 2 Nov 2026

What is the main purpose of the alt attribute on an <img> element?

  1. To set the width and height of the image
  2. To add a border around the image
  3. To describe the image for screen readers Correct answer
  4. To link the image to another web page

Correct answer

C. To describe the image for screen readers

18 views

MCQSEXAM

Explanation

alt text is read aloud by screen readers and is shown if the image fails to load. Search engines also use it to understand images, which supports SEO.

Reference

Asked in: NTS, PPSC, Web Developer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More HTML MCQs

Practise all HTML MCQs

Similar MCQs