jQuery id选择器不工作时,有.在ID


jQuery id selector not working when have . in ID

html代码如下:

<div id="chatbox_dipesh.parmar" class="chatbox">
  //html markup which is validated
</div>

在上面的代码dipesh.parmardiv动态添加。

我正在使用下面的代码访问它。

$("#chatbox_"+chatboxtitle).show();

其中chatboxtitledipesh.parmar,但未选择div。

.不是有效的ID。?

我的jQuery加载,它不与其他库冲突,也包装到$(function(){ })

谢谢。

转义。

看到这个:方向