How to open a window with a specific size with JavaScript?

Spread the love

To open a window with a specific size with JavaScript, we call window.open with a string with the window dimensions.

For instance, we write

window.open("http://example.com", "mywin", "width=500,height=500");

to call window.open to open http://example.com with width and height set to 500px.

Leave a Reply

Your email address will not be published. Required fields are marked *