Why does the target property in the link have an underscore?

I coded for many years, and only at that moment I realized that the target property of the <a> element requires that all their values ​​begin with an underscore (many of us know this), but I don’t know Do you know why? I mean from the top of my head, I don’t remember another value that requires starting with an underline, besides this. Does anyone know what is the reason for this implementation, and what other values ​​start with underlining?

This is just a historical question, but it would be great to know why everyone uses this convention, which I think applies only to target .

target - ( _blank , _self _parent , _top )

+7
syntax html history
source share
2 answers

This is not a convention; it is specified in the standard ( 4.0 , 5 ) that there are four reserved names for the target attribute: _blank, _self, _parent and _top. You may have other target values, but they will customize names that must begin with a letter. If reserved starts with an otherwise illegal value, this distinguishes them from custom target names.

+7
source share
  • The value of target may be the name frame .
  • frame may have the name " blank ".
  • Conflict!

There must be a way to disambiguate: is it the name of the frame or is it the name of the reserved viewing context?

So let's prefix any reserved name with a specific character and forbid this character to be used as the first character in other values.

+5
source share

All Articles