The window object represents the web browser’s window.
There are various methods available in the window.
one of them is resizeTo()
.
resizeTo()
the method is used to resize the window.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <!DOCTYPE html> <html> <head> <script type="text/javascript"> let child1; function openb() { child1=window.open('','Test','resizable,width=300,height=200'); child1.focus(); } function resize400() { child1.focus(); child1.resizeTo(400,400); } function resize500() { child1.focus(); child1.resizeTo(500,500); } function increase50() { child1.focus(); child1.resizeBy(+50,+50); } function decrease50() { child1.focus(); child1.resizeBy(-50,-50); } </script> </head> <body> <input type="button" value="open" onclick="openb()"/> <input type="button" value="resize to 400" onclick="resize400()"/> <input type="button" value="resize to 500" onclick="resize500()"/> <input type="button" value="increase by 50" onclick="increase50()"/> <input type="button" value="decrease by 50" onclick="decrease50()"/> </body> </html> |