$(document).ready(function() {
$('input[type = "checkbox"]').change(function() { //when a checkbox is checked
var nvalues = $('input[type="checkbox"]:checked').map(function() {
return this.value;
}).get();
if (nvalues.length > 0) {
var fin = nvalues.value;
$('#here').html(fin);
} else {
$('#here').html("WTF");
}
});
});
here I'am storing the checked values as array using map but the output is empty.
Aucun commentaire:
Enregistrer un commentaire