1

I am opening a window in another tab in my code, but the problem is the focus shifts to new tab opened, I want the focus to remain on the current window

I have searched for it, but have not got any solution, the focus() function is as I have understood is useful when opening popups.

I am using : window.open() function

window.open("myurl");
Deepanshu Goyal
  • 2,738
  • 3
  • 34
  • 61

1 Answers1

1

http://www.pageresource.com/jscript/jwinopen.htm also check this

You can't directly control this, because it can be configured by the user. You might try "_newtab" which might work for Firefox but really you shouldn't rely on a new tab being opened. The user may have their browser settings set to open a new tab when a popup window is opened or it may show up as a popup. It just all depends on the browser settings.

M.I.T.
  • 1,040
  • 2
  • 17
  • 34