lundi 3 juillet 2017

javascript If-Else Statement skip If condition

As you can see in the picture the value of the r.SalaryGrade is null. Why it skip my IF condition and goes to Else?. I make sure that if is an empty string and null it will add a class to a textbox. Did I do something wrong?.

 if (r.SalaryGrade == "" && r.SalaryGrade == null) { $("#JobGradeId").addClass('validation'); }
 else { $("#JobGradeId").removeClass('validation'); }

enter image description here

Aucun commentaire:

Enregistrer un commentaire