Can I have a div with id as number?
eg
While TJ Crowder's answer is conceptually good, it doesn't work for descendant CSS selectors.
Escaping only the first character followed by space does work however (as at Chrome 49)
Assume the following HTML snippet:
play that funky music
The following statement:
document.querySelector("#\\31 23456 .blah .yadah").style.fontStyle = "italic";
correctly displays play that funky music