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
Explain the difference between parent() and parents() methods in jquery? : jquery mobile
Tell me how to use migrate jquery plugin if possible? : jquery mobile
What is $() in jquery?
Explain the concepts of "$ function" in jquery with an example?
Which sign is used as a shortcut for jQuery?
What are selectors in jquery?
Explain the use of jquery .each() function? : jquery mobile
How can you select all elements in a page using jquery?
Explain "beforesend(xhr)" paremeter of jquery ajax method?
What were the biggest challenges of getting the 1.7 release out there?
What is called chaining?
How to programmatically trigger a click event that's being handled by jquery?
Difference between prop() and attr()? : jQuery Mobile
Why we need jquery mobile? : jquery mobile
What are the popular jquery cdn? : jquery mobile