If in some of my tabs alert() is executed, then this tab becomes selected instantly. The thing is - this alert() box is ugly. I have created with my design and all.. But when I call it - tab is not selected/focused. window.focus(); does not work. Any ideas?
Window.focus() Method The focus() method is used to focus on the new open window.
You cannot reliably force windows or tabs to grab focus. Some browsers are more amenable to the idea than others: IE will generally allow it, but Firefox has to be configured by the user to allow it, and Safari will basically never honor a focus request. (Well, almost never.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With