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
What are the advantages of using cdn?
What is jquery.size()? : jquery mobile
Can you please explain the difference between javascript and jquery? : jquery mobile
How does the jQuery pushStack function work?
What does jQuery data() function do?
Mention the differences between javascript and jquery.
Mention the advantages of cdn? : jQuery Mobile
Name some of the methods of jquery used to provide effects?
What is a use of jquery filter?
What is the difference between find and children methods in jquery?
Explain type paremeter of jquery ajax method?
How is the deferred method in jquery important in relation to animate method?
What is called chaining?
What is the use of html() method in jquery?
What are features of jquery or what can be done using jquery?