jeudi 1 octobre 2015

Why am I getting a Javascript "if" failure?

alert(Tag);  // Tag shows it is set to 0 (ZERO) which is less than 10.

if ( Tag < 10) { alert("adding.."); Tag=Tag+10; }
else { alert("Fail"); }
alert(Tag);

// alert shows me "fail" // and alert shows "0"

So, it says its zero, if statement DOES NOT show it less than 10, and it remains zero.... What am I doing wrong??

Aucun commentaire:

Enregistrer un commentaire