When I want to refer to some part of a webpage with the "http://example.com/#foo
"-method, which one is The One to use:
<h1><a name="foo"/>Foo Title</h1>
or
<h1 id="foo">Foo Title</h1>
I know that both work, but are they equal, or do they have semantic differences?
Edit: The (X)HTML-dialect I'm working on is HTML5, but don't let that constrain your answers and feel free to answer dialect-agnostically.