mike
mike

Reputation: 67

The opposite of this jquery function

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.

Upvotes: 0

Views: 604

Answers (2)

Vivek
Vivek

Reputation: 11028

Try this-

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

Upvotes: 0

eyelidlessness
eyelidlessness

Reputation: 63529

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

Upvotes: 2

Related Questions