$(input[]).each 仅在 firefox 中抛出语法错误
$(input[]).each throwing syntax error in firefox only
我正在做一个网络项目,但遇到了一个奇怪的问题。
我有一个文本区域如下:
<textarea style="margin-bottom: 5px" id="txtSupportDescription" name="txtSupportDescription[]" placeholder="Support Description" rows="10"></textarea>
然后我有以下jquery
var supportComments = [];
$('textarea[name="txtSupportDescription[]"').each(function()
{
supportComments.push($(this).val());
});
它在 Chrome 和 IE 中工作正常,但在 firefox 中我收到以下错误:
错误:语法错误,无法识别的表达式:]" 但它在 jQuery 库中抛出错误。
我不明白为什么在 Chrome 和 IE 都很好的情况下 Firefox 会出现这个问题。
您似乎在最后缺少右括号“]”。应该是:
$('textarea[name="txtSupportDescription[]"]')
我正在做一个网络项目,但遇到了一个奇怪的问题。
我有一个文本区域如下:
<textarea style="margin-bottom: 5px" id="txtSupportDescription" name="txtSupportDescription[]" placeholder="Support Description" rows="10"></textarea>
然后我有以下jquery
var supportComments = [];
$('textarea[name="txtSupportDescription[]"').each(function()
{
supportComments.push($(this).val());
});
它在 Chrome 和 IE 中工作正常,但在 firefox 中我收到以下错误:
错误:语法错误,无法识别的表达式:]" 但它在 jQuery 库中抛出错误。
我不明白为什么在 Chrome 和 IE 都很好的情况下 Firefox 会出现这个问题。
您似乎在最后缺少右括号“]”。应该是:
$('textarea[name="txtSupportDescription[]"]')