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 $("div") will select?
How you get server response from an ajax request using jquery?
What the use of $ symbol in jquery.
What is the use of noconflict() method in jquery?
How to load jQuery locally when CDN fails?
Define .siblings() method in jquery?
What are jquery selectors?
What are features of jquery or what can be done using jquery?
What is a CDN?
How to get attributes of an element using jQuery?
What is method chaining in jquery and what are the advantages?
What are the different ways of using $.connect function in jquery?