HTML | Window resizeBy() Method
The resizeBy() method in HTML Window is used to resize a window by the specified amount, relative to its current size.
Syntax:
resizeBy(width, height)
property value:
- width: A that specifies the resize pixels of width.
- height: A that specifies the resize pixels of height.
Example:
<!DOCTYPE html> <html> <head> <title> Window resizeBy() Method </title> <style> h1 { color: green; } </style> </head> <body> <center> <h1> Geeks for Geeks </h1> <button onclick="openWin()"> New window </button> <button onclick="resizeWin()"> Resize window </button> <script> var myWindow; function openWin() { myWindow = window.open("", "", "width=100, height=100"); } function resizeWin() { myWindow.resizeBy(300, 300); myWindow.focus(); } </script> </center> </body> </html> |
chevron_right
filter_none
Output:
Before:

After:


Supported Browsers: The browser supported by Window resizeBy() Method are listed below:
- Google Chrome
- Mozilla Firefox
- Edge
- Opera
- Safari
Recommended Posts:
- HTML | Window scrollBy() method
- HTML | Window alert( ) Method
- HTML | Window moveBy() Method
- HTML | Window createPopup() Method
- HTML | Window resizeTo() Method
- HTML | Window moveTo() Method
- HTML | DOM Window btoa() Method
- HTML | DOM Window stop() Method
- HTML | Window atob( ) Method
- Javascript | Window Blur() and Window Focus() Method
- HTML | Window top( ) Property
- HTML | Window self( ) Property
- HTML | Window name Property
- HTML | DOM Window closed Property
- HTML | DOM Window localStorage Properties
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



