<a href="section-name">Some Link Text</a>I just by coincidence while scanning the W3C documentation for anchor tags discovered that there is another method which in my case proved to be easier and more compact.
Let's say you have a section in your web page titled as follows:
<h2>My Section</h2>If I wanted to link to such a section, I would modify it as follows:
<h2><a name="section-name">My Section</a>But I discovered that I can alternatively write it as follows:
<h2 id="section-name">My Section</h2>This has the exact same effect as the first method and looks neater and easier to write.
By the way, using internal anchors and linking to them from the same web page helps a lot in search engine optimization (SEO). Google seems to love web pages that have such links in them. They give spiders many clues and Google just loves this and usually ranks such web pages high.