Question

I have been coding for many years and only at this moment I just realized that the property target from the element <a> requires all their values start with an underscore (a lot of us know that), but I don't know why? I mean from the top of my head I don't remember another value which required to start with an underscore except for that.

Does anybody know what is the reason behind this implementation, and what other values start with an underscore?

This is just a historical question, but it would be cool to know why everybody uses this convention which I think is only applied to target.

target - (_blank, _self _parent, _top)

Was it helpful?

Solution 2

It's not a convention; it's specified in the standard (4.0, 5) that the four reserved names for the target attribute are _blank, _self, _parent, and _top. You can have other target values, but they would be custom names which must start with a letter. Having the reserved ones start with an otherwise illegal value distinguishes them from custom named targets.

OTHER TIPS

  1. The target value can be the name of a frame.
  2. The frame could have the name "blank".
  3. Conflict!

There needs to be a way to disambiguate: Is this the name of a frame or is this the name of a reserved browsing context?

So let’s prefix any reserved name with a specific character and disallow this character for use as first character in other values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top