Name attribute is obsolete, what is the correct behavior when dealing with anchors?
- by Tchalvak
Putting some code through the html5 validator, I get this:
Warning: The name attribute on the a
element is obsolete. Consider putting
an id attribute on the nearest
container instead.
I find that unclear. Is the "nearest container" for an anchor link the a itself, so that the correct code would be <a id='blah'> instead of <a name='blah'>? Or are empty placeholder <a> tags as a whole deprecated, and anchors can simply point to any element with an id instead?