Move a window to a new location in JavaScript

Description

The following code shows how to move a window to a new location.

Example


<!--   w  w  w .  ja va  2 s .co  m-->
<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript">

//move the window to the upper-left coordinate
window.moveTo(0,0);

</script>
</body>
</html>

Click to view the demo

The code above generates the following result.

Move a window to a new location in JavaScript