javascript - Selecting an element whose ID has a period in it -


this question has answer here:

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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -