javascript - Selecting an element whose ID has a period in it -
this question has answer here:
- can't select div id=“:1” 2 answers
i have element has period in it:
<div id="parent"> <div id="my.element"></div> </div>
and want select using prototype. i've tried this:
$$('#parent #my.element');
but isn't working because thinks .element
part class. there way around this?
fyi, isn't option rename element. unfortunately i'm stuck naming scheme prototype
thanks
you can escape dot in css, should work
$$('#parent #my\\.element');
edit: stated oriol , tested, indeed have use 2 slashes
Comments
Post a Comment