某个标签的id中存在#,document.getElementById可以直接选择,但是jquery就不行了,直接报错,需要怎么进行兼容性处理呢
Questions about the js selector? - PHP Chinese website Q&A - Questions about the js selector? - PHP Chinese website Q&A
Take a look around and learn.
试试用双反斜杠转义,即对于id="foo#bar",用$('#foo\\#bar')试试看~
Questions about the js selector? - PHP Chinese website Q&A - Questions about the js selector? - PHP Chinese website Q&A
Take a look around and learn.
试试用双反斜杠转义,即对于id="foo#bar",用$('#foo\\#bar')试试看~