可能重复:
How to select html nodes by ID with jquery when the id contains a dot?
我有一个网站,其中包含类似以下内容的元素:
<p id="root.SomeCoolThing">Some Cool Thing</p>
我不能像$('#root.SomeCoolThing')
一样选择带有jQuery的段落,因为jQuery认为,SomeCoolThing
是带有id="root"
的元素的类。
如何使用jQuery选择此元素?我想避免像这样的构造:
$(document.getElementById('root.SomeCoolThing'))
https://stackoverflow.com/questions/9930577
复制相似问题