<!DOCTYPE html>
<html>
<body>

<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="../index.html"></iframe>
<iframe src="../index.html"></iframe>

<script>
function myFunction() {
    window.frames[0].location = "http://www.w3ii.com/jsref";
}
</script>

</body>
</html>