Interview Question

What is loading lazy?

Loading="lazy" allows eligible images or iframes to load later.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The `loading` attribute provides a browser loading hint for an `<img>` or `<iframe>`; `lazy` allows deferred loading when appropriate. β€’ It is written inside an element’s opening tag. β€’ The HTML Standard limits which elements may use it and which values are valid. β€’ Browsers apply the attribute when they process the element or the resource it controls.

💡 Simple Example

<img src="/images/gallery.jpg" loading="lazy" alt="Children painting in an art class" width="640" height="360">

⚡ Quick Revision

Loading="lazy" allows eligible images or iframes to load later.