![](/img/trans.png)
[英]jquery show not working with href tel click on android chrome
[英]jquery is not working with this id #tel / fax
我在這一行中使用了這個 ID(電話/傳真)
$("#" + val.target.id).attr('disabled', 'disabled');
然后我收到如下錯誤:
語法錯誤,無法識別的表達式:#tel / fax
id 屬性中不能有空格。 您可以使用 replace() 函數將空格替換為任何其他字符。
ID 應該是一個沒有空格和特殊字符的單詞。 jQuery 選擇的工作方式與 css 選擇相同。 例如,如果你不能在你的 css #tel / fax {...}
寫,那么你不能在你的 jQuery 中做同樣的事情 - $('#tel / fax');
會給你一個錯誤。
只需更改您的元素 ID 即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.