What is wrong with this code line "$('#myid.3').text('blah blah!!!');"
Answer / 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 |
What are the slow selectors in jQuery?
What are the different types of selectors in jquery?
How to load jQuery locally when CDN fails?
Is jQuery replacement of Java Script?
What is the use of queue() in jquery?
How to use css() in jquery?
In what scenarios jQuery can be used?
How can you add a jquery library in your project?
How to use connect?
What is the difference between "#" and "." selector in JQuery?
What is the difference between jquery and javascript?
What is the struts2 jquery plugin and its advantages.