Adwin Wijaya wrote:
I just wonder why in jquery we need to escape such an "unusuall"
characters ? (I found in prototype, we dont need to do that, I am not
trying to compare, but i just wonder about that).

The colon has special meaning in CSS, it denotes all kind of pseudo selectors:
http://www.w3.org/TR/CSS21/selector.html#pseudo-elements

Even in standard CSS, if you want to select ids with a colon in it, you need to escape it:

#foo\:bar selects <div id="foo:bar">

http://www.w3.org/TR/CSS21/syndata.html#characters

In prototype it may work with a colon in it if you use $() (which is document.getElementById under the hood), but I doubt it would work with Prototypes $$() (not tested though).



--Klaus



Reply via email to