HTML DOM Window moveBy() Method (original) (raw)
Last Updated : 2 Aug, 2023
The **Window moveBy() method is used for moving a window with a specified number of pixels relative to its current coordinates. The Window moveBy() method accepts two parameters x and y which denote the number of pixels to move the window horizontally and vertically.
**Syntax:
window.moveBy(x, y)
**Parameters Used:
- **x: It is a mandatory parameter that specifies the number of pixels to move the window horizontally.
- **y: It is a mandatory parameter that specifies the number of pixels to move the window vertically.
The below program illustrates the Window moveBy() Method:
**Example: Moving a new window relative to its current position
HTML `
Window moveBy() Method in HTML