You have to use double slashes to escape it, that's right. It also
works in CSS:

$('#test2\\.3').hide()
#test2\.3 { display:none }

On Jan 22, 5:36 pm, spinn...@vip.hr wrote:
> I believe that it will function as intended if you escape the dot,
> like so:
> $("#test2\.3")
>
> although I've tried now in Firebug and it seems you have to escape the
> slash too, like so (don't know why, is it because of Firebug, or?):
> $("#test2\\.3")
>
> Cheers,
> Dennis.
>
> On Jan 22, 5:21 pm, "finn.herp...@marfinn-software.de"
>
> <finn.herp...@marfinn-software.de> wrote:
> > Sounds good.
>
> > Too bad my ids are given by an external xml-file. But since I wrote a
> > workaround to replace all . in the ids with _ it's fine for me ;).
>
> > Thanks
>
> > Cheers
>
> > On Jan 22, 4:13 pm, Liam Potter <radioactiv...@gmail.com> wrote:
>
> > > jQuery will read it as id "test2" with the class "3"
>
> > > While periods are allowed in the attribute I would advise against them,
> > > as it's not just jQuery that could struggle with them but most CSS as
> > > well, as #test2.3 with again read as id "test2" with the class "3".
>
> > > Finn Herpich wrote:
> > > > Hi everyone,
>
> > > > the attached example-code shows a problem I encountered today (firebug
> > > > needed).
>
> > > > If an id-attribute contains dots, like
> > > > <p id="test2.3"></p>
> > > >  jQuery isn't able to find it.
> > > > If the dots are replaced by underscores everything works fine.
>
> > > > Afaik there is no limitation for the id which prohibit dots as a used
> > > > symbol, so I guess this is a bug or for some reason not wanted?
>
> > > > Cheers

Reply via email to