timolawl timolawl - 1 year ago 80
HTML Question

Is the underscore in target="_blank" no longer needed?

Today I made a typo while helping someone with a question and wrote

instead of
. The interesting thing was that it still worked. I decided to try it out in other browsers as well to see if it was only Chrome that allowed for
without the underscore, but it seems to work in Firefox and Safari as well.

Is there a reason why the underscore can be dropped? And if it's legitimate to write it as
, why do most if not all sources still say to write it out as

Answer Source

If you have target="blank", open it twice and it opens in the same window. If you have target="_blank" twice, it opens in two different windows. You can check using:

<a href="http://google.com/" target="blank">Google</a>
<a href="http://en.wikipedia.org/" target="blank">Wikipedia</a>

Same with, _blank opening in two different windows:

<a href="http://google.com/" target="_blank">Google</a>
<a href="http://en.wikipedia.org/" target="_blank">Wikipedia</a>

In simple terms, it would be considered as blank will be the name of the new window, while _blank is a special keyword, opens a new window without a name. Correct me if I am wrong.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download