I always thought the standard way to specify a fragment identifier is by <a name="foo"></a>
.
<a href="#foo">go to foo</a>
<a name="foo"></a> <!-- obsolete method, it seems -->
<p>some content under that anchor with name</p>
But it seems like this is the old way, and the new way is using an id
, like this:
<a href="#bar">go to bar</a>
<p id="bar">some content under that p with id</p>
In fact, the W3C validator says that name
is obsolete for the <a>
element. So are there 2 ways to jump to the fragment identifier but 1 of them is obsolete? (And when did that happen?)
(there are other questions about the difference between id
and name
, but this one is about fragment identifier)