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
How to validate email using jquery?
How to check or uncheck all checkboxes using jquery?
What is the difference between find and children methods?
What is jquery selectors? Give some examples.
How we can get the value of a radio button using jquery?
Explain the difference between .empty() and .remove() ?
What is the difference between onload() and document.ready()?
How do I pull a native DOM element from a jQuery object?
In what scenarios jQuery can be used?
What is $() in jquery library?
Explain .on()? : jquery mobile
Explain event.preventdefault? : jquery mobile
Tell me does jquery 2.0 supports ie? : jquery mobile
List the advantages of jquery?
What is the difference between jquery-x.x.x.js and jquery.x.x.x min.js?