<html>
<body>
<h1>The Window Object</h1>
<h2>The frameElement Property</h2>
<p>Click the button.</p>
<p>If the window is in a frame, change its URL to "w3schools.com".</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
const frame = window.frameElement;
if (frame) {
frame.src = "https://www.w3schools.com/";
}
}
</script>
</body>
</html>