72

Since I approached the web programming, to open a link in a new window I always used

target="blank"

but most of the time, here and in the rest of the web I have ever seen use:

target="_blank"

Both forms work (of course), but I do not know the difference between the two versions and they do not know what the correct way (and why)....

1

3 Answers 3

127

blank targets an existing frame or window called "blank". A new window is created only if "blank" doesn't already exist.

_blank is a reserved name which targets a new, unnamed window.

4
  • Did you mean to say tab instead of window? developer.mozilla.org/en-US/docs/Web/HTML/Element/a
    – Gwater17
    Nov 3, 2017 at 0:21
  • 11
    @MattGoldwater target=_blank is older than the concept of browser tabs. It usually opens a new tab nowadays.
    – haslo
    Nov 29, 2017 at 14:41
  • 1
    @MattGoldwater Also, I don't think there's a requirement for browsers to have tabs. That's a convenience thing in the desktop paradigm, but afaik is largely done differently on mobile.
    – Mathieu K.
    Mar 15, 2018 at 18:50
  • Let call former valid navigable target name and latter navigable target keyword.
    – Yarl
    Mar 9 at 20:46
33

In short, use target="_blank" it always open a new window but use target="blank" it will open a new window at the first time and this window will be reused after the first.

0
11

Both target="_blank" && target="blank" will open new window or tab. The difference is

target="_blank"

On every click, it will open in a new window.

target="blank"

On another (Multiple) clicks, it will Open in the same window that opened for the first click (reuses the same tab). It reuses the same tab for all the linked documents with attribute ="blank"


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.