We can lost focus from a window by using blur() method. Here is the syntax
Once the focus is lost then the window will be minimized ( not closed ) .
To get the window again we have to use window.focus() You can see the source code of blur.htm
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>Demo of blur and focus of a window</title>
<script language=javascript>

function to_close(){

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

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

function to_blur(){
tm.blur();   // Keeping the focus out 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="Focus" onclick="to_focus()";>
<input type="button" name="btn" value="Blur" onclick="to_blur()";>
The code for child window is available at moveBy
Visitors Rating
Your Rating


Post Comment This is for short comments only. Use the forum for more discussions.

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2017 All rights reserved worldwide Privacy Policy Disclaimer