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 check/uncheck an input in jquery?
What is the difference between find and children methods in jquery?
What is the difference between javascript and jquery?
Jquery can be used in what scenarios?
How to work with jQuery parent(), children() and siblings()?
Why is the block display style used for animations?
What are the advantages of method chaining in jquery?
What is the latest version of jquery?
What are the the two types of cdns?
How to load jQuery locally when CDN fails?
What were the biggest challenges of getting the jQuery 1.7 release ?
How to programmatically trigger a click event thats being handled by jquery only?