The moveTo() method

The moveTo() method moves the window to a particular location on the screen based on the given coordinates.


Let’s take the previous example and replace moveBy() with moveTo().

<h1>I am an amazing new window<br>
I have been opened with JavaScript.</h1>
<input type="button" value="Move Window" onclick="window.moveTo(50,50);" />
<input type="button" value="Close Window" onclick="window.close();" />

Leave a Reply