What is wrong with this code line "$('#myid.3').text('blah blah!!!');"
Answer Posted / chaitanya
The problem with above statement is that the selectors is having meta characters and to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[]^`{|}~ ) as a literal part of a name, it must be escaped with with two backslashes: \. For example, an element with id="foo.bar", can use the selector $("#foo\.bar").
So the correct syntax is,
Hide Copy Code
$('#myid\.3').text('blah blah!!!');
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How to keep the submit text from showing with jquery mobile? : jquery mobile
What are selectors in jquery?
What are the advantages of jQuery?
In what scenarios jQuery can be used?
How to select class in jquery?
What is normally not included in a cloned copy? : jQuery Mobile
How to fetch the values of selected checkbox array using jquery?
Tell me do I need to add the jquery file both at the master page and content page as well?
Is jquery still relevant 2019?
How can we give face effect in jquery?
Tell me is jquery a w3c standard? : jquery mobile
How we can check if an element is empty or not using jquery?
Tell me what are the slow selectors in jquery? : jquery mobile
Tell me an example usage of jquery mobile? : jquery mobile
What is event preventdefault () and event stoppropagation () in jquery?