Possible Duplicate:
How do I get jQuery to select elements with a . (period) in their ID?
I tried to run the following code:
$('#info-mail.ru .domain-info').toggle();
example here
And #info-mail.ru as I understood interpreted as id="info-mail" and class="ru", but I have the following structure:
<div id="info-mail.ru">
<p class="domain-info">
Some cool info
Some cool info
Some cool info
Some cool info
</p>
</div>
How can I shield "." char in selector statement? Or the only way is to replace all "." with "_" (for example)?
TIA!
Escape .
with a double backslash, one for the literal and the other for jQuery:
$('#info-mail\\.ru .domain-info').toggle();
See jQuery FAQ for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With