What does loading="lazy" on an <img> element do?
A
Prevents the image from being cached
B
Loads the image at a lower resolution
C
Loads the image only after a user clicks it
D
Delays loading until the image nears the viewport
Correct answer
Correct answer
D. Delays loading until the image nears the viewport
17 views
⚔️
Challenge a friend on HTML
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
Explanation
Native lazy loading saves bandwidth and speeds up initial page load. Images above the fold should not be lazy-loaded, because that can hurt Largest Contentful Paint.
Reference
Asked in: NTS, Web Developer Interviews
Doubts & discussionNot sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ Which attribute makes a table cell span across three columns? Next MCQ › What is the purpose of the srcset attribute on an <img> element?