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 |
Is jQuery a library for client scripting or server scripting?
How do I check if the DOM is ready?
Explain jquery filter?
Does jquery 2.0 supports ie? : jquery mobile
Can you please explain the difference between prop and attr? : jquery mobile
What's next on the hitlist with jquery ui?
Explain the difference between .empty() and .remove() ?
Mac, windows or linux? Why do you love this platform while using jquery?
Define .siblings() method in jquery?
Tell me can we have multiple document.ready() function on the same page? : jquery mobile
Can you write a jquery code to select all links inside the paragraph?
How do you install/use jquery in a project.