Skip to main content
HTML Validation

Bad value X for attribute “loading” on element “iframe”.

About This HTML Issue

The loading attribute on an iframe element accepts only lazy or eager, so an empty value like loading="" or any other word is invalid.

With eager, the browser loads the frame right away, which is also what happens when the attribute is missing. With lazy, it waits until the frame gets close to the viewport, which saves bandwidth for embeds further down the page. The empty string is not one of these keywords. Browsers treat it as an invalid value and fall back to eager loading, so the attribute does nothing except fail validation. Values such as true or auto trigger the same error.

An empty loading="" usually comes from a template or CMS plugin that prints the attribute even when its lazy-loading option is off. Fix it where the markup is generated: output loading="lazy" when you want the frame deferred, and leave the attribute out otherwise.

Invalid example

<iframe src="https://example.com/embed/map" title="Store location map" loading=""></iframe>

Valid example

Defer the frame until the user scrolls near it:

<iframe src="https://example.com/embed/map" title="Store location map" loading="lazy"></iframe>

Or drop the attribute to load it right away:

<iframe src="https://example.com/embed/map" title="Store location map"></iframe>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries