HTML: how to force links to open in a new tab, not new window

Moon picture Moon · Oct 19, 2010 · Viewed 185.4k times · Source

I use target="_blank" to open links in a new tab. But in IE it opens a new window which is completely logical because that is what _blank is supposed to do.

And i don't know how target="_blank" behaves in other browsers.

Is there something to force links to open in a new tab. If the browser supports tabs... else make a new window

Answer

Moin Zaman picture Moin Zaman · Oct 19, 2010

There is no way to do that as the author of the HTML that a browser renders. At least not yet that I know of. Its pretty much up to the browser and its settings / preferences that are set by users themselves.

Also, you shouldn't impose this upon any user. A browser is the user's property. If a user wants to open all links in tabs or in new windows, then let the user do exactly that.

It's good that we can't do certain things. target=_blank is still abused and popups have been done to death.