Next / Previous / Contents / TCC Help System / NM Tech homepage

4.5. Fragment identifiers

In HTML, named locations in the document (also known as fragment identifiers) were defined by the “name” attribute. In XHTML, this is replaced by the id attribute. Any element can carry an id attribute.

Suppose you want to define a fragment identifier on a page so that the browser will jump to there if the URL ends in “#planks”:

HTMLXHTML
<h2><a name="planks">Planks</a></h2>
<h2 id="planks">Planks</h2>