Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Target='_blank' to show in new window, NOT new tab, possible?

People also ask

How do I make a link open in a new tab instead of a new window?

Open in a new tab To open a link in a new tab, click the link by pressing down your middle mouse button, or right-click the link and select Open link in New Tab.

Which target value opens the link in a new tab?

The target attribute set to _blank , which tells the browser to open the link in a new tab/window, depending on the browser's settings.

How do you add a target blank?

Conclusion. You can use the target="_blank" attribute if you want your users to click on a link that opens up a new browser tab. The target="_blank" attribute is used inside the opening anchor tag like this.


This is working fine

window.open(yoururl, "Popup", "location,status,scrollbars,resizable,width=800, height=800");

For all parameters see window.open

Edited Date:- 12th Aug, 2021 If you does not want to use JavaScript Function, then You can write Inline Script for Open Page in New Windows, & it is support all the modern browsers

<a href="https://stackoverflow.com/" onclick="window.open('https://stackoverflow.com/', 'newwindow', 'width=400, height=250'); return false;">with href</a>


<a href="#" onclick="window.open('https://stackoverflow.com/', 'newwindow', 'width=400, height=250'); return false;">without href</a>

You can see Live Working example on this jsfiddle.net link


You cannot control this - it's entirely at the discretion of the user-agent; which is the point, after all. All you can specify is that the page be opened in a different viewpane context, and it's up to the user to decide how they want your window to take up their screen space/taskbar list/Alt-Tab shortcuts etc.

In fact I'd go even further and say that if at all possible you should avoid opening up a new tab/window at all. I know that I get a little annoyed when websites do this, and it feels a bit clunky and 1990s what with all the Ajax and floating divs and magic we have nowadays.


<a href="javascript:window.open('http://example.com/popup.html','blank')">Contact</a>

I believe this is a browser-only setting that cannot be set from HTML or Javascript.