Hello,
I'm usingso that users can reach a section of the page they're currently browsing.Code:<a name="search"></a>
Is this technique ok? Is there something more clever to do in our day and age?
![]()
| SitePoint Sponsor |





Hello,
I'm usingso that users can reach a section of the page they're currently browsing.Code:<a name="search"></a>
Is this technique ok? Is there something more clever to do in our day and age?
![]()

That's only useful for Netscape 4 and earlier. Most modern browsers no longer support it since there was a new way introduced into the standards back in 1997 and apart from Netscape all other browsers since that time have supported the newer way.
Just add an id attribute to whatever tag you want to use as the destination of your link.
For example if you want to jump to the div that contains the navigation then just use <div id="nav"> and then <a href="#nav">go to nav</a> will jump you straight to it.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
One thing is for sure: the name attribute on an anchor is obsolete in HTML5. (See, W3C HTML5 overview, 11 Obsolete features.)
Bookmarks