unable to retrieve a div element using jquery id selector,when Email ID used as the Div ID -


i unable use email id div id jquery .

when use $("#xyz@gmail.com") access div , facing following error

syntax error, unrecognized expression: #xyz@gmail.com

i not able retrieve using jquery selector. want know why email id can't used jquery selector , workaround same.

thanks in advance!!!

you need escape special character @ , . 2 backslashes \\. docs:

to use of meta-characters ( such !"#$%&'()*+,./:;<=>?@[]^`{|}~ ) literal part of name, must escaped with 2 backslashes: \\

$("#xyz\\@gmail\\.com") 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -