1D0-610 · Question #75
Which <1mg> tag attribute is required in order for HTML5 documents to validate without error?
The correct answer is B. alt. The alt attribute is required on <img> elements because HTML5 mandates it for accessibility - it provides alternative text for screen readers and displays when an image fails to load. The W3C HTML5 validator will flag an <img> tag as an error if alt is missing, even if the…
Question
Which <1mg> tag attribute is required in order for HTML5 documents to validate without error?
Options
- Aid
- Balt
- Cname
- Dtitle
How the community answered
(55 responses)- A4% (2)
- B93% (51)
- C2% (1)
- D2% (1)
Explanation
The alt attribute is required on <img> elements because HTML5 mandates it for accessibility - it provides alternative text for screen readers and displays when an image fails to load. The W3C HTML5 validator will flag an <img> tag as an error if alt is missing, even if the value is an empty string (alt="").
The distractors are all optional attributes: id is a global attribute used for targeting elements with CSS/JS but has no validation requirement; name is largely obsolete on <img> tags (it was used in older HTML); title provides a tooltip on hover but is purely optional and has no effect on validation.
Memory tip: Think "ALT = ALways There" - the alt attribute must always be present on images for both accessibility compliance and valid HTML5.
Topics
Community Discussion
No community discussion yet for this question.