Edit This Code:
<!DOCTYPE html>
<html>
<body>

<iframe id="myframe" src="../default.asp.html"></iframe>

<p>Click the button to change the src attribute in the iframe.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    document.getElementById("myframe").src = "http://www.cnn.com";
}
</script>

</body>
</html>


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