Can I use an anchor ID starting with a number in HTML5?

anchor, html, numbers

Solution

Yes, this is perfectly valid in HTML5.

3.2.3.1 The `id` attribute

The `id` attribute specifies its element's unique identifier (ID). [DOM]

The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters.

Note: There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.

http://www.w3.org/TR/html5/dom.html#the-id-attribute (emphasis added)

Problem

Can I use an anchor ID starting with a number in HTML5? ``` <a id="1" class="anchor"></a> ``` I was told this was a NO NO. But it seems to work fine in IE9, Firefox and Chrome. So, what gives?

Original source