<select name="search[quick_dates]" id="search_quick_dates">
...
</select>
和jQuery:
f.find('select[name=search[quick_dates]]').bind('change', { form: f }, function(e){
...
}
引发错误:
Uncaught Error: Syntax error, unrecognized expression: select[name=search[quick_dates]]
我可以更新我的jQuery而不是更改属性名称吗?
要将任何元字符(例如!“#$%&'()* +,。/ :; <=>?@ [] ^`{|}〜)用作名称的文字部分,必须使用用反斜杠转义:
更改:
f.find('select[name=search[quick_dates]]')
对此:
f.find('select[name="search\\[quick_dates\\]"]')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句