Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Window Object</h1>
<h2>The frames Property</h2>
<p>Click the button to change the location of the first iframe element (index 0).</p>
<button onclick="myFunction()">Try it</button>
<br><br>
<iframe src="https://www.w3schools.com" style="width:100%;height:300px"></iframe>
<iframe src="https://www.w3schools.com" style="width:100%;height:300px"></iframe>
<script>
function myFunction() {
  window.frames[0].location = "https://www.w3schools.com/jsref/";
}
</script>
</body>
</html>