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 does dollar sign ($) means in jquery? : jquery mobile
Explain the common methods of sending a request to a server.
Does jQuery 2.0 supports IE?
When can you use jquery?
Need to add jQuery file in both Master and Content page?
what does $("div") will select? : jquery mobile
Explain .empty() vs .remove() vs .detach() in jquery
How to create clone of any object using jQuery?
What are source maps in jQuery?
How to load jQuery from CDN?
How to add a class to html element?
What is difference between prop and attr?