HTML DOM Window resizeBy() Method (original) (raw)

Last Updated : 15 Jun, 2023

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:

Example:

html `

Window resizeBy() Method

Geeks for Geeks

New window Resize window
    <script>
        var myWindow;

        function openWin() {
            myWindow = 
              window.open("", "",
                          "width=100, height=100");
        }

        function resizeWin() {
            myWindow.resizeBy(300, 300);
            myWindow.focus();
        }
    </script>
</center>

`

Output:

Before:

After:

Supported Browsers: The browser supported by Window resizeBy() Method are listed below: