3
I’m taking the value of a checkbox and putting in an array valores
, My question is: how, when unchecking the checkbox, to remove this value from my array? Because if I check and uncheck the checkbox 10 times it will put the value in the array 10 times.
var checkbox = document.getElementById("checkbox");
var valores = [];
checkbox.onchange = function(){
valores.push(event.target.value);
}
the function
pop
removes the last array item and not a specific item...– RFL
True, it was inattentive. Amended and thank you!
– Pedro Paulo