Why does target="_blank" have an underscore in front? (2024)

Origin of _blank and reserved targets

  • Commenters agree _blank comes from the mid‑90s Netscape frames era, where target referred to named frames/windows.
  • Netscape’s original proposal and later HTML specs define four reserved target names: _blank, _self, _parent, _top.
  • Historically, any non‑existing target name opened a new window; the first click created that window, later clicks reused it. _blank was standardized specifically to always open a fresh window, never reusing an existing one.

Why the underscore specifically?

  • Key point from the specs: early frame names/IDs had to start with an alphanumeric character. Because of that, any name beginning with _ was guaranteed not to clash with user‑defined frame names.
  • The underscore thus marks a reserved namespace for special semantics (_blank, _self, _parent, _top) while avoiding collisions with normal frame names like main, nav, or blank.
  • Several commenters find the article’s explanation incomplete until this “must start with a letter/alpha” rule is noted.
  • Some infer cultural influence from C/C++ and other languages, where leading _ often denotes reserved/private identifiers, but there’s no direct historical citation in the thread—this is presented as plausible, not proven.

Frames, frameset, iframes, and their legacy

  • People reminisce about building early “web apps” with <frameset> and frames, using targets heavily.
  • There’s debate over whether deprecating frames was a mistake:
    • Pro‑frames: they solved “part of the page changes, other parts don’t” and enabled simple multi‑pane UIs and persistent media players.
    • Anti‑frames: they broke URLs, bookmarking, linking, search indexing, and often produced poor UX.
  • Modern analogues like iframes, htmx/Turbo, LiveView, micro‑frontends, and proposals like “triptych” are seen as a reinvention/refinement of the same pattern.

Modern use and criticism of target

  • Outside of _blank and iframes, few strong modern use cases for target are mentioned.
  • Some view target="_blank" as user‑hostile (tab spam, broken back/forward history) and argue users should control whether links open in new tabs; they’d prefer browsers to neuter _blank.
  • Security details appear: _blank now implicitly gets rel="noopener" in many browsers, whereas custom targets like _new do not.

Cross‑device and underscore culture

  • A “shower thought” suggests target="_mobile" / "_desktop" to move sessions between devices; replies say this belongs in browser/OS “share” or “send to device” features, not HTML.
  • Several comments connect the underscore prefix to broader programming conventions (private/reserved names, “ignored” variables), reinforcing the idea of _something as a special/implementation namespace.