I struggle with that. I have a list of elements and part of the form, when something is checked, it adds the "checked" class to the corresponding list item.
<ul>
<li class="title">Checklist</li>
<li class="checkType checked">Card Type</li>
<li class="checkNumber checked">Card Number</li>
<li class="checkName checked">Name on Card</li>
<li class="checkMonth checked">Expiry Month</li>
<li class="checkYear checked">Expiry Year</li>
<li class="checkCode checked">Security Code</li>
</ul>
.title{font-size:23px; font-weight:bold;}
.checked{ color:#f00;}
But I need jQuery to verify that each element has an checkedEXCEPT class title.
Is this doable?
Demo: http://jsfiddle.net/bQtEQ/1/
Thanks to the answers, I now have the following
var counting = $("li.checked:not(.title)").length;
if (counting == 6){
console.log(counting);
}
source
share