vendredi 30 janvier 2015

If statement does not work when condition is met

Here is my code:



var count = 2;
var decrementAmount = 1;

function reduceVariable() {
count -= decrementAmount;
}

$("#button").click(function() {
reduceVariable();
});

if (count == 0) {
$("#avrageReactionTime").html("Hello");
};


When i click my button twice the div that has the id avrageReactionTime does not change to have the text hello. Why do i have this problem...


Aucun commentaire:

Enregistrer un commentaire