Adding Content to an Iframe Using Srcdoc

Using the srcdoc attribute in an iframe allows you to directly add HTML content inside it.

<iframe srcdoc="<p>Hello, World!</p>"></iframe>

The srcdoc attribute lets you write a HTML document directly into an iframe, without needing to call an external file. It provides an easy and flexible way to manage the content of an iframe.

Copyright © 2024. Design and code by myself with Next.js. Fork it and create yours