For some reason, Magento uses colons inside the ID names of some elements in the checkout:
|
1 |
<label for="billing:company"><?php echo $this->__('Company') ?></label> |
Prototype handles this fine, but if you want to use the ID as a selector in your stylesheet, or perform some action on it using jQuery, it causes problems. You must use escape methods of different kinds.
In CSS files, you could escape the colon with a backslash, and that would work in most browsers. To support IE7 and below though, it is necessary to use the hexadecimal code for a colon, which is /3A:
|
1 2 3 |
#billing/3Acompany{ /* your styles */ } |
If jQuery’s your thing, escape with two backslashes:
|
1 2 3 4 5 |
<script type="text/javascript"> //<![CDATA[ jQuery('#billing\\:company').bind('hover', someAction()) //]]> </script> |
Not exactly the most elegant solutions. Particularly the CSS one, as it makes for a selector that is unnatural and difficult to read, but c’est la vie.