<!DOCTYPE html>
<html lang="en-US">
<body>
<button onclick="myOpen()">Open Window</button>
<button onclick="myMoveBy()">MoveBy Window</button>
<script>
var myWindow;
function myOpen(){
myWindow = window.open("", "myWindow", "width=400, height=200");
}
function myMoveBy(){
myWindow.moveBy(40, 40);
myWindow.focus();
}
</script>
<p><strong>Note</strong>: Try to click 'MoveBy Window' button more than once.</p> </body>
</html>