HTML5 Please

iframe[srcdoc]

Safe to use with polyfillhtml

This attribute allows for in-line specification of iframe content.

Verdict
Safe to use
Category
HTML features
Browser support
Can I Use
Works in
all modern browsers

Should you use iframe[srcdoc] in 2026?

For non-supporting browsers, you can use this srcdoc polyfill which utilizes script-targeted URLs to provide this functionality in non-supporting browsers.

Also see [more about implementing iframe[srcdoc]](http://weblog.bocoup.com/third-party-javascript-development-future/#iframe-srcdoc) responsibly on Bocoup's blog.

Polyfills and fallbacks

srcdoc polyfill