HTML5: ID for anchors, name attribute obsolete

When attempting to validate pages with the W3C validator, you may notice that using the 'name' attribute is no longer valid. That's because the 'name' attribute is not supported in HTML5 and is considered obsolete. For valid markup...

When attempting to validate pages with the W3C validator, you may notice that using the ‘name’ attribute is no longer valid. That’s because the ‘name’ attribute is not supported in HTML5 and is considered obsolete. For valid markup…

When attempting to validate pages with the W3C validator, you may notice that using the ‘name’ attribute is no longer valid. That’s because the ‘name’ attribute is not supported in HTML5 and is considered obsolete. For valid markup, a newer construct is recommended: use the ‘id’ attribute instead. See the example below for the correct markup:

<!-- Incorrect Markup - 'name' attribute -->
<ul>
    <li><a href="#one">Section One</a></li>
</ul>

<h2><a name="one">Section One</a></h2>
<!-- Correct Markup - 'id' attribute -->
<ul>
    <li><a href="#one">Section One</a></li>
</ul>

<h2><a id="one">Section One</a></h2>

Ready to talk shop?

Let's connect. We can take your website to the next level.

Get A Quote
Let's Talk