Why is the target attribute (or rather its value) so strangely formatted?


#1


https://www.codecademy.com/courses/learn-html-css/lessons/common-elements/exercises/link-attributes


I wonder why the HTML consortium chose to place an underscore (_) in front of the values. What is the logic behind this? Does it have some historic reason?


<a href="test.html" target="_blank">Link</a>


#2

Maybe reading
= discussions / opinions =
found by google search
html target _blank site:stackoverflow.com
https://stackoverflow.com/questions/4964130/target-blank-vs-target-new


#3

Thanks for your response, Leonhard.

The link tells me "Names starting with an underscore are reserved for special keywords." That doesn't quite answer my question, though. The Python interpreter, for instance, knows quite well that "def" is a special keyword without us placing an underscore in front of it. I'm sure there's more to it.


#4

it is the specification by w3.org
read
6.2 SGML basic types
and
6.16 Frame target names
in
http://www.w3.org/TR/html4/types.html


#5

Unfortunately, the specification shares little on the original reasoning behind it.


#6

Maybe this helps
https://stackoverflow.com/questions/20172280/what-does-href-stand-for

=end=


#7

It seems like there's little knowledge on the actual reasoning behind it: https://superuser.com/questions/707522/html-historical-or-technical-reason-for-target-blank-with-underscore.

Maybe it was introduced by some browser manufacturer who put little thought into it and that's why it hasn't be used anywhere else other than with target. Just my guess.


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.