with select view:
$('#user@mail.com') browser throws error:
Uncaught Error: Syntax error, unrecognized expression: #user@mail.com
How to escape the @ symbol?
with select view:
$('#user@mail.com') browser throws error:
Uncaught Error: Syntax error, unrecognized expression: #user@mail.com
How to escape the @ symbol?
$('#user\\@mail\\.com') Help here http://api.jquery.com/category/selectors/
To use any of the meta-characters (such as! "# $% & '() * +,. / :; <=>? @ [] ^` {|} ~) As a literal part of the name, it must be escaped with two backslashes: \. For example, an element with id = "foo.bar", you can use the selector $ ("# foo \\ bar").
another option ...
$('[id="user@mail.com"]').text('Введите запрос'); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div id="user@mail.com"></div> Source: https://ru.stackoverflow.com/questions/574889/
All Articles