lundi 2 novembre 2020

Display new object if statement is true [closed]

Building a true or false quiz. I cant seem to display the next object inside my array.

`

function questionIndex() {
    document.getElementById("question").innerHTML = question;
    }

btnFalse.j.addEventListener('click', event => {
    if (event.target.value === answer) {
        console.log("Correct");
        points++
        currentItemIndex++;
        console.log(points);
        questionIndex();
        
    } else {
        console.log("Wrong");
        currentItemIndex++;
        console.log(points);
        questionIndex();
    }
}
)

`

When this code runs it does not perform the function "questionIndex".

Aucun commentaire:

Enregistrer un commentaire