Move a window to a new location in Javascript

Description

window.moveTo(x,y) moves the window to the upper-left coordinate.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script type="text/javascript"> 
<!-- w ww.  j a  v a 2s.co  m-->
            //move the window to the upper-left coordinate 
            window.moveTo(0,0); 

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

Click to view the demo

The following code moves the window to position (200, 300).


window.moveTo(200, 300); 




















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window