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 |
How to add and remove css classes to an element using jquery?
Which are the popular jQuery CDN? and what is the advantage of using CDN?
What is difference between .setinterval() and .delay() ?
Explain deferred and promise object in jquery? : jquery mobile
How to use connect?
Where can we download JQuery?
Which command will give a version of jQuery?
What are the fastest selectors in jQuery?
What were the biggest challenges of getting the 1.7 release out there?
Explain the difference between $(this) and 'this' in jquery?
How do you stop the currently-running animation?
What is each() function in jQuery? How do you use it?