Michael J. answered 06/02/19
Mathematics and Computer Programming for Gifted Students
That depends on what version of HTML you are creating. For this answer HTML 4 and 5 are really the only valid concerns.
HTML 4:
ID tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")
HTML 5:
ID tokens must contain at least one character, and must not contain whitespace, such as spaces, tabs, and new line characters.
Universally:
The ID attribute can be used on any HTML element.
The ID token is case-sensitive.