Recently had a debate on a question here where the user in the answer said that ID starts with a number is acceptable in HTML5, so is that true? I don't see any relevant documentation on this topic, also he provided me a link to this answer here, but seems like relevant link is no more.
So the question is, do HTML5 allow ids
to start with a number?
Now for sure this fails in CSS --
<div id="5hello">Fails Completely</div>
#5hello {
color: red;
}
Update: I am not even sure, that HTML5 allows the id's
to start with a number or not, it's just that declaring id
on an element is not enough, as HTML alone is not a question here, but does using <!DOCTYPE html>
enables other technologies like CSS and JavaScript to work with the id's starting with no.? Am sure CSS fails, not tested with JavaScript but am sure that will fail too.