I'm using the following to get an array of values from a set of checkboxes that have been checked by the end-user:
var array = jQuery('input:checkbox[name=items]:checked').map(function() {
return this.value;
}).get();
Instead of an array of values, I'd like to get an array of classnames.
My checkboxes:
<input type="checkbox" name="items" value="vOne" class="cOne">
<input type="checkbox" name="items" value="vTwo" class="cTwo">
<input type="checkbox" name="items" value="vThree" class="cThree">
I've tried the following which doesn't work:
var array = jQuery('input:checkbox[name=items]:checked').map(function() {
return this.class;
}).get();