Edit This Code:
<!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>


Result:
Try it Yourself - © w3schools.com
Privacy Policy