Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | Window resizeTo() Method

  • Difficulty Level : Basic
  • Last Updated : 26 Jul, 2019

The resizeTo() method is used to resizes a window to the specified width and height.


window.resizeTo(width, height)

Parameter Values:

  • width: Sets the width of the window, in pixels.
  • height: Sets the height of the window, in pixels.

Example: Resize the window.

<!DOCTYPE html>
        Window resizeTo() Method
        h1 {
            color: green;
        <h1>Geeks for Geeks</h1>
        <button onclick="openWin()">
            New window
        <button onclick="resizeWin()">
            Resize window
            var myWindow;
            function openWin() {
                myWindow =
          "", "",
                        "width=100, height=100");
            function resizeWin() {
                myWindow.resizeTo(300, 300);


New window:

Resize window:

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

  • Google Chrome
  • Internet Explorer
  • Mozilla Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!