Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute target="_newtab" for links

What is "_newtab" value for target attribute in HTML "a" tag? I can't find information about the compatibility for browsers.

Does it will work in all modern browsers?

How it will work if in browser option users set to open links in new window and not in new tab?

Does this value is described anywhere in HTML standards?

like image 471
Alex Dn Avatar asked Jan 12 '23 14:01

Alex Dn


1 Answers

Are you sure, whether it is _new or _newtab?

There is no value called _newtab for target attribute.

May this SO answer gives us a better information,

Using target="_new" is technically invalid according to the specifications, but as far as I know every browser will behave the same way:

  • it will search for a tab or window with the context name "_new" * if a "_new" tab/window is found, then the URL is loaded into it * if it's not found, a new tab/window is created with the context name "_new", and the URL loaded into it

Note target="_new" will behave exactly the same as target="new", and the latter is valid HTML while the former is invalid HTML.

These are possible values for target attribute: _blank, _self, _parent, or _top


I think what you're trying to refer is target-new, a CSS3 property.

The target-new property specifies whether new destination links should open in a new window or in a new tab of an existing window.

target-new:window;  //Opens a link in new window
target-new:tab;   //Open a link in new tab

Note: The target-new property is not supported in any of the major browsers.

like image 184
Praveen Avatar answered Jan 22 '23 13:01

Praveen