Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html Target Attribute not supported

Tags:

html

target

I was just on w3Schools looking at target and found that it is no longer supported by any of the major browsers. A brief google search did not reveal the reason for this? Should I avoid the use of target all together?

like image 684
andrew Avatar asked Dec 09 '10 15:12

andrew


People also ask

How do I add a target attribute in HTML?

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.

What is Target attribute in HTML?

The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. The target attribute defines a name of, or keyword for, a browsing context (e.g. tab, window, or inline frame).

Is target =_ blank deprecated?

It looks like target="_blank" is still alright. It is listed as a browsing context keyword in the latest HTML5 draft.

What does target _blank mean in HTML?

Value. Description. _blank. Opens the linked document in a new window or tab.


1 Answers

target attribute is supported by all browsers.

It has been removed from HTML4 Strict and XHTML 1 Strict, because these don't allow frames, and because forcing new windows on users isn't always good idea (e.g. Back button in new window will be disabled, which confuses some users).

target has been added back in HTML5. You can use it, but don't abuse it.

It's OK if you want to open help page in new window on page that has a long form (you don't want users to lose content of the form), but it's not OK to force every link in new window in hope it'll make your page harder to leave.

And please don't try cheat validator by using scripts to open new windows. It gives same negative effect to users (or even worse if it breaks when JS is disabled), but is harder to detect and control than target.

BTW: Please don't treat W3Schools as authoritative. They're not affiliated with W3C in any way, and their tutorials often contain mistakes.

like image 124
Kornel Avatar answered Sep 19 '22 09:09

Kornel