我使用的是jquery 1.3.2,但我已经更新到最新版本:
以下内容不适用于最新版本的 jquery - 这里出了什么问题?
var input = $(this);
// get the associated label using the input's id
var label = $('label[for=' + input.attr('id') + ']');
//get type, for classname suffix
var inputType = (input.is('[type=checkbox]')) ? 'checkbox' : 'radio';
// wrap the input + label in a div
$('<div class="custom-' + inputType + '"></div>').insertBefore(input).append(input, label);
// find all inputs in this set using the shared name attribute
var allInputs = $('input[name=' + input.attr('name') + ']');
最佳答案
尝试将最后一行更改为:
var allInputs = $('input[name="' + input.attr('name') + '"]');
关于jquery - 语法错误,无法识别的表达式 : [name=ctl00$MainContent$mainProgress],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11722160/