If you're using a .NET Web Forms an JQuery you may have this problem when you're trying to select an HTML element with a dollar sign on it (generated by the .net platform), something like this: $('#element$with$dollarSign').
This will generate an error:
This is because jQuery considers this an invalid selector, or more correctly said, a meta-character (!"#$%&'()*+,./:;<=>?@[]^`{|}~).
To successfully use this meta-charaters you will need to escape it with backslashes, like this $('#element\$with\$dollarSign')
So if you're on a project and are dealing with this issues before using a generated id you can escape the string before using: '#element$with$dollarSign'.replace(/[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g, "\\$&")
You can check this issue with more detail on JQuery page: http://api.jquery.com/category/selectors/