.val() form validation question
I am trying to validate a users input to a math question to verify they are not a bot, I am unsure how to check the input as you can see here i have if(verify.val() != 10){ (the answer to the question is always 10) it doesn't work so i'm obviously doing it wrong, could anyone point me in the right direction?
- function validateBot(){
- //it's NOT valid
- if(bot.val() != 10){
- bot.addClass("error2");
- botInfo.text("You're not a robot are you?");
- }
- //it's valid
- else{
- bot.removeClass("error2");
- bot.addClass("success2");
- }