myWindow.focus() & myWindow.blur()

With these two properties, you can create a new pop-up window. The difference is that myWindow.focus() makes sure that the new window gets the focus by sending the new window to the front. On the other hand, myWindow.blur() sends the new window to the background, so the user can focus on the main window and consider the new windows as an afterthought. These two properties are opposites from each other which accounts them as "setters" and "getters". You can use myWindow.focus() property if the new pop-up window requires an immediate attention from your user. You can use myWindow.blur() property if the new window does not need to be seen right away, but is an afterthought. Have you ever had bunch of windows opened for deals for hotels and rental cars when you closed your window of an airline website? That instance uses the blur property.

  • myWindow.focus()

  • myWindow.blur()