Replacing named anchor with id attribute on element?
Posted: Tue May 03, 2016 1:04 am
Currently (at least in SeaMonkey) it's possible to use the id attribute of an element for same purpose as
For example, to scroll to a point "foo" in a page, the following appears equivalent:
Either way, can click a link like this and end up scrolled to the blah blah content.
How stable is that behavior / how much can I rely on it being there? Is this a browser quirk or standard behavior?
I discovered it by accident and can't find anything about it on MDN nor the WHATWG standards.
Thanks
Code: Select all
<a name="...">
Code: Select all
<a name="foo"></a>
<div>blah blah content</div>
Code: Select all
<div id="foo">blah blah content</div>
Code: Select all
<a href="#foo">link</a>
How stable is that behavior / how much can I rely on it being there? Is this a browser quirk or standard behavior?
I discovered it by accident and can't find anything about it on MDN nor the WHATWG standards.
Thanks