resizeTo(): resize window to a fixed width and height

We will try to develop an example in which by click of a button we will resize window to 300 width and 300 height
DEMO of resizeTo()

Here is the code.
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Demo of resizeTo to fix width and height of a window</title>
<script language=javascript>

function to_close(){

function to_open(){"moveby-child.htm","Ratting","width=250,height=150,0,top=200,status=0,");

function to_resizeTo(){
tm.focus();   // Keeping the focus on small window


<input type="button" name="btn" value="Open" onclick="to_open()";>
<input type="button" name="btn" value="Close" onclick="to_close()";>
<input type="button" name="btn" value="Resize To" onclick="to_resizeTo()";>
Return to <a href=resizeto.php>resizeTo</a> | <a href=window-object.php>window object</a>


The code for child window is available at moveBy

Window Object When we lost focus on a window : Blur Redirect Page
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer