Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

HTML Window resizeTo() Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The HTML Window resizeTo() Method is used to resize a window to the specified width and height. 


window.resizeTo(width, height)


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

Example: In this example, we will resize the window by using the Window resize To() method. 


<h1 style="color: green">GeeksforGeeks</h1>
    Click the new window button to create a window
    and Resize Window button to resize the window
<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);



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

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 4
  • Mozilla Firefox 1
  • Opera 12.1
  • Safari 1

We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.

My Personal Notes arrow_drop_up
Last Updated : 08 Dec, 2022
Like Article
Save Article
Similar Reads
Related Tutorials