Today I made a typo while helping someone with a question and wrote target="blank"
instead of target="_blank"
. 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 target="blank"
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 target="blank"
, why do most if not all sources still say to write it out as target="_blank"
?
Today I made a typo while helping someone with a question and wrote target="blank"
instead of target="_blank"
. 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 target="blank"
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 target="blank"
, why do most if not all sources still say to write it out as target="_blank"
?
1 Answer
Reset to default 24If 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.