Hyperlink name attribute removed from html5

Published: {ts '2014-01-28 00:00:00'}
Author: Steven Neiland
Site Url: http://www.neiland.net/article/hyperlink-name-attribute-removed-from-html5/

So tonight I was working on my blog and I decided to put in some bookmarks. For some reason my mind completely blanked that you use the name attribute on the hyperlink tag. A quick quick google later and I was cooking, but during the process I learned that the name attribute of the hyperlink <a> tag is obsolete in html5 which came as a bit of a surprise since it still works from what I can see.

Previously

Previously if we wanted to link to a particular point on a page we would use a <a> tag with a unique name on it like thus.

Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5

Chapter 1

blah blah...

Chapter 2

blah blah...

Chapter 3

blah blah...

Chapter 4

blah blah...

Chapter 5

blah blah...

New HTML5 Way

With html5 we now use the "id" attribute on any html tag. So for example we would rewrite the above as follows, putting the id attribute on the h2 tags.

Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5

Chapter 1

blah blah...

Chapter 2

blah blah...

Chapter 3

blah blah...

Chapter 4

blah blah...

Chapter 5

blah blah...

While I was surprised that the name attribute is supposedly no longer supported I must admit that I think the method of putting an id on an element is a lot cleaner to my eye.