Changing browser's windows' size with jquery or javascript

For example i will create five button

Example:

Button1’s value : 640480
Button2’s value : 1024
600
Button3’s value : 1600900
Button4’s value : 800
600
If user click to button1 i want to change browser’s windows’ size. I want this via JQuery but maybe javascript…

EDIT:

And how can i change windows’ position for computer’s screen. Third question :slight_smile: how can i create random number?

Most people leave their browser setting for window resizing at the default of not allowing JavaScript to change it. After all changing the window size for the page in one tab could break the layout of the pages in all the other tabs (at least in so far as the way the browser owner wants them all to look).

Some might allow you to do it if you are actually opening a new windowand have the values specified as the width and height in the third parameter. That’s assuming they don’t have it overridden to open in a new tab or at their preferred size instead.

To create a random number in JavaScript use Math.random()

Thanks… How can i move browser’s window?