Source code
<input type=text value='Welcome to plus2net' class='form-control' id=my_input>
<input type="button" name="btn" value="Click to Focus text input" onclick="to_focus()";>
<input type="button" name="btn" value="Click to Blur text input" onclick="to_blur()";>
<script language=javascript>
function to_focus(){

function to_blur(){
window.focus method can bring focus to the window. Here is the syntax
When window is opened , the focus remains on it.

If it is minimized or closed then the window focus will return to main window or parent window.
DEMO of window.blur and window focus method

Check the status of the window focus by using document.hasFocus()

You can see the source code of this demo at blur()
Window Status closed or not
Window Object Bookmark a page 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