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 |
Where jQuery code is getting executed?
How do you select element by ID in jQuery?
Explain .empty() vs .remove() vs .detach() in jquery
How does jquery store data related to an element?
What is the advantage of using the minified version of jquery rather than using the conventional one?
What is get()? : jquery mobile
Define type paremeter of jquery ajax method?
What is the latest version of jquery?
Tell me do I need to add the jquery file both at the master page and content page as well?
Explain some of the key concepts of good code organization patterns.
What is resize() function in jquery?
Tell me how to use migrate jquery plugin if possible? : jquery mobile