<p>When creating the <code>id</code> attributes for HTML elements, what rules are there for the value?</p>

From the
HTML 4 specification
:
ID and NAME 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 (".").
A common mistake is to use an ID that starts with a digit.