Legal characters in id name

https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute (Last
Updated 26 February 2021) says:

"The id attribute specifies its element's unique identifier (ID). 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.  An element's unique identifier can be
used for a variety of purposes, most notably as a way to link to specific
parts of a document using fragments, as a way to target an element when
scripting, and as a way to style a specific element from CSS."

The HTML5 validator accepts id="[-123-]" but not href="#[-123-]":

"Bad value #[-13-] for attribute href on element a: Illegal character in
fragment: [ is not allowed."

But clicking on the link works.

Here is the web page (I'm in the middle of converting it to HTML5):

http://www.columbia.edu/cu/computinghistory/brennan/new.html

Frank da Cruz
fdc@columbia.edu

Received on Saturday, 27 February 2021 15:05:26 UTC