";s:4:"text";s:3872:"The window object represents an open window in a browser. document.hasFocus to check window active or not Returns boolean value. Note: This property is read-only. It contains settings, delimited by a comma. With two large monitors, and generally 20 or so windows open, it is very hard to "guess" or "remember" which window has the focus. If you have some constantly running Ajax or JavaScript updates on a page, it might be nice to pause these when the browser is minimized or in the background, or when the user switches to another tab. var window_status=document.hasFocus(); We will get True if window is in focus ( or active ) or False if it is not in focus. Definition and Usage. The activeElement property returns the currently focused element in the document.
Note: There is no public standard that applies to the Window object, but all major browsers support it. If there’s already a window with such name – the given URL opens in it, otherwise a new window is opened. Checking the status of focus By using if condition checking we can display message to user. Detecting that which TextBox has focus - JavaScript Jan 31, 2008 01:52 AM | sanjeev_kejriwal | LINK Can anybody help me to know how it is possible to detect that which Textbox has focus through java script only . Learn the best of web development.