Ad

If Statement Always Return True Even For Simple Integer Values

- 1 answer

i facing issue my If statement returning always true, for each value.

 var radioValue = parseInt($("input[name=packageRadio]:checked").val())
            alert(radioValue); // 1000, 500, -1



            if ((radioValue) == -1);
            {
                alert("no");

            }

for every value alert("no") is always calling.

Ad

Answer

Remove semicolon after if

if ((radioValue) == -1){
   alert("no");

}
Ad
source: stackoverflow.com
Ad