jQuery: selecting checked checkbox
The name of the field isn’t foo, it is foo[]. You could use the attributeStartsWith selector: $(“input[name^=’foo’]:checked:enabled”,’#myform’); Ideally, you’d be able to do this: $(“input[name=”foo[]”]:checked:enabled”,’#myform’); But as this answer explains, jQuery uses this to parse the value part of the attr=value condition: ([‘”]*)(.*?)\3|)\s*\] \3 being the group containing the opening quotes, which weirdly are allowed … Read more