So i got this working with the first value x to be pushed and spliced but after it only pushes or doesn't do anything
<td>
<input type="checkbox" name="updateListings[]" value='+x+' onclick="doSomething(this)">
</td>
function doSomething(cb) {
if ($(cb).is(":checked")) {
uLIndex.push(cb.value);
alert(uLIndex);
} else {
uLIndex.splice(cb.value, 1);
alert(uLIndex);
}
}
Aucun commentaire:
Enregistrer un commentaire