<html>
<body>
<iframe id="myFrame" srcdoc="<p>Hello world!</p>" src="demo_iframe.htm"></iframe>
<p>Click the button to display the HTML content that is shown in the iframe.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myFrame").srcdoc;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_iframe_srcdoc by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:46:34 GMT -->
</html>