For HTML5 is a valid id attribute:
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
Since it isn't a valid CSS identifier, in order to use it with querySelector()
or $()
you should escape it like this:
#\\.someMethodName
Mozilla Developer Network:
To match ID or selectors that do not follow the CSS syntax (by using a colon or space inappropriately for example), you must escape the character with a back slash. As the backslash is an escape character in JavaScript, if you are entering a literal string, you must escape it twice (once for the JavaScript string, and another time for querySelector):
Be conscious that it isn't a valid HTML4 id attribute