Skip to content

ID value can start with a number #25200

@alanfluff

Description

@alanfluff

MDN URL

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id

What specific section or headline is this issue about?

#sect2

What information was incorrect, unhelpful, or incomplete?

This bold phrase: "should start with a letter" here:

Note: Technically, the value for an id attribute may contain any character, except whitespace characters. However, to avoid inadvertent errors, only ASCII letters, digits, '_', and '-' should be used and the value for an id attribute should start with a letter.

contradicts the HTML5 spec which says:

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.

What did you expect to see?

The blue note agreeing with the HTML5 spec, i.e. stating that an ID could start with a letter.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:HTMLHypertext Markup Language docseffort: smallThis task is a small effort.help wantedIf you know something about this topic, we would love your help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions