<html>
<body>
<p>Open "myWindow" and move the new window to the top left corner of the screen:</p>
<button onclick="openWin()">Open "myWindow"</button>
<button onclick="moveWin()">Move "myWindow"</button>
<script>
var myWindow;
function openWin() {
myWindow=window.open("", "myWindow", "width=200, height=100");
myWindow.document.write("<p>This is 'myWindow'</p>");
}
function moveWin() {
myWindow.moveTo(500, 100);
myWindow.focus();
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_moveto by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:04:10 GMT -->
</html>