samedi 23 janvier 2021

How to get value from checkbox checked using javascript?

Why my javascript code didn't work? This output value is NaN.

javascript
for (var checkbox of markedCheckbox) {
    if(checkbox.checked){
      if(AI.includes(checkbox.id)){
        console.log("Flu Burung");
        document.getElementById("kesimpulan").hidden=false;
        document.getElementById("PE01").hidden=false;    
        document.getElementById("Solusi01").hidden=false; 

        //myBugs code
        for (var checkbox of markedCheckbox){
          if(AI.includes(checkbox.value)){
            y+=parseInt(checkbox.value);
          }
        }
        probabilitas = document.getElementById("probabilitas");
        probabilitas.innerHTML = (probabilitas.innerHTML.slice(0, -1) + y / 10 ) * 100;
      } else if {
    }
  }
}



Aucun commentaire:

Enregistrer un commentaire