Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <iframe id="myFrame" srcdoc="<p>Hello world!</p>" src="demo_iframe.htm"></iframe> <p>Click the button to change the HTML content that is shown in the iframe.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("myFrame").srcdoc = "<p>Some new content inside the iframe!</p>"; } </script> </body> </html>