I have three drop-downs. Each time you select an item from the dropdown-list, it is added to the total value and it is displayed below in a label. When the user clicks on the 'X' of the label, the label is removed and the value of the item should be substracted from the dropdown-list. However, it isn't substracted.
This is link where I have the form:
https://codepen.io/MoisosxD/pen/gOPpXGQ
You see to remove the label I have it like this:
onclick="desmarcarspan1();"
dentro del js así:
function desmarcarspan1(){
var total = document.getElementById("totalGeneral");
var total1 = new Array(total);
var NuevoTotal = total.textContent;
console.log(total.textContent);
var ans10 = document.getElementById("ans-10");
ans10.style.display = "none";
}
But I have not done anything else I do not know how to do the subtraction and to uncheck the selector.