开发者

The opposite of this jquery function

开发者 https://www.devze.com 2023-03-20 19:22 出处:网络
I\'ve been using a bit of jquery in my asp.net project and are trying 开发者_开发知识库to select all unchecked checkboxes that match a certain style class - and this 1st bit works fine.

I've been using a bit of jquery in my asp.net project and are trying 开发者_开发知识库to select all unchecked checkboxes that match a certain style class - and this 1st bit works fine.

$('span.cbmac input:not(:checked)').each(function() {";
//etc
});

I would like to use the opposite of this query, ie select all checked boxes that match the span tag cb.mac.

I've tried

!$('span.cbmac input:is(:checked)').each(function() {";
//etc
});

and a few variations but no luck so far, any ideas appreciated.


Any selector is an implied :is(). You would use span.cbmac :input:checked.


Try this-

$('span.cbmac input:checked)').each(function() {;
//etc
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号