The "id" attribute is not handled according to HTML5 specification
See original GitHub issueThe ‘#’ in a selector seems to follow the HTML4 specifications, so a selector like this : #1
raises a SelectorSyntaxError.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
What are valid values for the id attribute in HTML?
For HTML5: The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character....
Read more >3.2 Elements — HTML5 - W3C
The id attribute specifies its element's unique identifier (ID) . The value must be unique amongst all the IDs in the element's home...
Read more >id - HTML: HyperText Markup Language - MDN Web Docs
The id global attribute defines an identifier (ID) which must be unique in the whole document. Its purpose is to identify the element...
Read more >HTML Standard
1 Introduction; 2 Common infrastructure; 3 Semantics, structure, and APIs of HTML documents; 4 The elements of HTML; 5 Microdata; 6 User interaction ......
Read more >8.9 HTML5-Friendly Markup - Java Platform, Enterprise Edition
Here, the jsf prefix is placed on the id attribute so that the HTML5 input tag's attributes are treated as part of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
CSS syntax doesn’t support ids that start with numbers unless you use an escape. HTML spec does support numbers, and you could even use weird unicode characters. People often will use CSS friendly ids to avoid this kind of issue as well, but it isn’t invalid HTML. Same goes for classes.
Thank you for your quick response and your help, as I said I had already a workaround for websites that use these types of id, but I can see that this is not a problem in the implementation !