Numeric ID

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
The w3C validator says that a numeric ID, such as:
<div id="1">
(or an ID beginning with a number) is invalid: "It is possible that you
violated the naming convention for this attribute. For example, id and
name attributes must begin with a letter, not a digit."

But I can't seem to find anything that says you can't use a numeric ID -
I'll grant that I'm not a master at reading the specs, but all I CAN
find is that an ID should be unique, and should not use character
encoding. Maybe I'm just not seeing it:

So - what about numeric ID's like above? Is it valid? And assuming it's
not, what sort of problems, aside from validation errors, would it cause?

Re: Numeric ID

Tony wrote:
Quoted text here. Click to load it

They're not valid. Refer to:

Re: Numeric ID

Tony wrote:

Quoted text here. Click to load it

"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 (".")."

You're reading the old HTML 4.0 specs, but it is there as well.

Quoted text here. Click to load it


Can't answer that; I've never used a number because it's against the
spec.  <g>

   -Friends don't let friends drive Vista

Site Timeline