Example 1 — Official Demo: input:not(:checked) + span
Select spans that sit right after unchecked inputs (jQuery API example).
var labels = $("input:not(:checked) + span").map(function () {
return this.textContent.trim();
}).get().join(", ");
console.log($("input:not(:checked)").length);
console.log(labels); How It Works
- Negate checked.
input:not(:checked)keeps only unchecked boxes. - Step to the span.
+ spantakes the immediate next sibling if it is a span. - Read labels. Map text content for a clear console list.

