I can’t change the text of my label when I uncheck my checkbox.
Thanks in advance for your help.
var checkBox_fruit = document.getElementById("fruit");
var label_fruit = document.getElementById("label_fruits");
checkBox_fruit.addEventListener('change', function () {
if (this.checked) {
// Checkbox is checked..
label_fruit.innerHTML = " fruits 1"; ////// its that who works
} else {
// Checkbox is not checked..
label_fruit.innerHTML = " fruits 2"; ////// its that who not works
}
Aucun commentaire:
Enregistrer un commentaire