Why does target="_blank" have an underscore in front? (2024)
Origin of _blank and reserved targets
- Commenters agree
_blankcomes from the mid‑90s Netscape frames era, wheretargetreferred 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.
_blankwas 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 likemain,nav, orblank. - 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
_blankand iframes, few strong modern use cases fortargetare 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:
_blanknow implicitly getsrel="noopener"in many browsers, whereas custom targets like_newdo 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
_somethingas a special/implementation namespace.